drawing op• Data kinds: table → table
• Call: import fullseye as fs; fs.ledger.vision_setup_drawing(layout, view='both', barrel_diameter_mm=30.0, body_mm=40.0, scale=None, title=None) (to call the implementation directly, import optdraw; optdraw.vision_setup_drawing(layout, view='both', barrel_diameter_mm=30.0, body_mm=40.0, scale=None, title=None); from the registry, opsoptics.get("vision_setup_drawing"))
Machine-vision setup drawing (table, a drawing dict) — side and top views drawn from optscene.vision_layout.
> The detailed description below is the original text — the summary and the headings are translated.
描くもの: 作業面(z = 0)と部品(scene があれば箱・円筒・球・板を投影、くり抜きは破線)、カメラ(鏡筒・本体・センサー面。鏡筒の先端 = 主点 = optscene のピンホール)、光軸(一点鎖線)、視野の錐(センサーの 4 隅の画素の縁から逆投影した 4 本の光線と、作業面の上の視野の四角)、被写界深度の帯(光軸に沿って ±DOF/2)、照明 5 種(ring = 円環と仰角、dome = 半球と天頂の穴、bar = 棒と仰角、coaxial = ハーフミラーと横の光源、backlight = 部品の下の面光源)と光の向きの矢印。寸法: 作動距離 WD・視野の幅(側面図は縦 = センサーの高さ方向、上面図は両方)・ DOF・照明の高さと半径・仰角。諸元の表(倍率・作動 F 値・回折限界・物体側の画素・DOF・律速)を文字で書く。
*view* は "side" / "top" / "both"。側面図は (y, z)、上面図は (y, x) で、第三角法の並び(上面図を側面図の上に置き、横軸 y を共有する)。センサーの像の横(camera の right)は世界の x、縦は y。★鏡筒の大きさ(*barrel_diameter_mm*)とカメラ本体(*body_mm*)は lens_spec に無いので図のための仮の寸法。作動距離は optscene の薄肉の模型どおり物体から主点まで(実機のカタログの WD は前玉の先端から)。
返り値の values: working_distance / fov_mm(横, 縦)/ dof_mm / magnification / fov_corners(作業面の上の 4 隅、3-D)/ lights(照明ごとの種類・高さ・半径・仰角)。
Every optics op validates its input before computing (nothing slips through silently):
• Units are baked into the argument name — _mm / _um / _deg / _mrad. Confusing mm with µm does not crash; it yields a plausible-looking wrong answer, so the name prevents it. Nothing here guesses the unit from the magnitude.
• Strings raise ValueError — float('50') succeeds, so an unparsed configuration value would slip through as a length (measured: thin_lens('50', '200') returned a plausible 66.667 mm). bool is refused too, as the implicit promotion True == 1.
• complex / masked arrays raise ValueError (real-valued slots only; silently dropping the imaginary part or peeling off the mask is refused). NaN/Inf raises ValueError on every input.
• Division by zero and its relatives are refused by name: focal length 0, radius of curvature 0, refractive index <= 0, a fully opaque aperture (all zeros, so the normalisation is 0/0), a PSF whose sum is <= 0, a Stokes vector with S0 = 0, and an object sitting at the front focal point (the image is at infinity).
• Only two ops return a non-finite value, and both state it as a contract: depth_of_field returns far_mm = inf beyond the hyperfocal distance (that is what the hyperfocal distance means), and gaussian_beam returns wavefront_radius_mm = inf at the waist (the radius of curvature of a plane wavefront). Both also return a finite companion (far_is_infinite / curvature_per_mm). Any other silent NaN/Inf is detected internally and raises ValueError — "float64 overflowed" and "the answer is infinite" are different claims, so the first is never returned wearing the face of the second.
• Size caps: generated grids are capped by optics.MAX_GRID (4096); supplied fields/PSFs/apertures by optics.MAX_FIELD_ELEMENTS (2^24); ABCD element chains by optics.MAX_SYSTEM_ELEMENTS (1024); Zernike by MAX_ZERNIKE_TERMS (512) / MAX_ZERNIKE_ORDER (40) / MAX_ZERNIKE_BASIS (2^25). This closes, fail-closed, the paths where a small argument triggers a huge internal allocation (measured: n_max=40 × 4096² needs 108 GB).
• Physically impossible states are refused too: a Stokes vector with degree of polarisation > 1, negative transmittance, negative intensity, and invalid Zernike indices such as n-|m| odd.
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• poc_optics_drawings — py -3.11 examples/poc_optics_drawings.py
table as input)abcd_matrix · wavefront_stats · sfr_from_edge · paraxial_trace · seidel_coefficients · spot_stats · tolerance_analysis · wavefront_from_opd
drawing)lens_section_drawing · lens_element_drawing · drawing_svg · drawing_dxf · drawing_raster · svg_entities · dxf_entities · noncoaxial_drawing
*Provenance: optdraw.py — OPTICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.