Capabilities and Scope
At this stage LensBench does one thing: the design, analysis, optimization and tolerancing of sequential imaging systems, plus file interchange and numerical reconciliation with Zemax. Below are the usable scope and the explicit limits of the current version; they are updated with each version. For an item-by-item comparison with Zemax see Zemax → LensBench mapping, and for how far the computation can be trusted see the validation report.
What it can do
Systems and surfaces
- Sequential systems: refraction, reflection (
MIRROR), fold mirrors and decenter/tilt (coordinate breaks) - Surface types: standard (sphere / conic), even and odd aspheres, toroidal (including cylindrical), tilted plane, ideal thin lens, diffractive surface (Binary 2), diffraction grating (transmissive / reflective, can be on a curved surface), Zernike sag surface (Standard / Fringe, freeform, Zernike coefficients optimizable), coordinate break
- Surface apertures (obscuration): circular aperture, circular obstruction, rectangular aperture, floating aperture, all of which can be decentered
- System aperture: entrance pupil diameter, image-space F/#, object-space NA, floating by stop size; object-space telecentric; afocal image space (telescopes, beam expanders: aberrations in angle, plane reference wave, MTF in cycles/mrad, angular magnification)
- Field: angle, object height, paraxial image height, real image height, with optional weights and vignetting factors; multiple wavelengths and a primary wavelength; ray aiming
- Solves and pickups: marginal / chief ray height, marginal / chief ray angle, F-number, best focus; pickups of radius, thickness and conic constant
- Multi-configuration (zoom / multiple configurations):
config+mclines take values per configuration (thickness, curvature, glass, field, wavelength, aperture, etc.); analysis and plotting run per configuration, and the layout can stack the configurations vertically; the merit function can be written per configuration, with joint multi-configuration optimization
Materials
- Glasses are matched exactly by "manufacturer:grade" and never fuzzily substituted; when several manufacturers share a name, you are asked to write it in full
- Public material data ships with the software (refractiveindex.info, CC0): about 1700 grades from OHARA, HIKARI, CDGM, HOYA, SUMITA, SCHOTT and other manufacturers, ready to use out of the box; you can also point directly at a material file with
file("…") - Use your own Zemax glass catalogs (
.AGFfiles or a whole directory; for the same manufacturer these take precedence over the bundled data); when a grade is not found, it tells you where the Zemax glass catalogs are on this machine; when importing a zmx, if a grade missing from the bundled library (mostly discontinued grades) is in this machine's Zemax glass catalogs, anagfline is added automatically to the .lens - Model glass
model(nd, vd)(with an optional dispersion model) and ideal materials; public data for common crystals and optical plastics is built in (CaF₂, germanium, silicon, fused silica, PMMA, etc.)
Analysis and plotting
- First-order quantities (focal length, back focal length, F/#, entrance and exit pupils, total length), single-ray trace, prescription table
- Spot diagram, spot density map, RMS vs field, full-field image quality map, ray fan, OPD fan, MTF, MTF vs field, through-focus MTF, Strehl, through-focus spot, field curvature and distortion, grid distortion, longitudinal aberration, lateral color, chromatic focal shift, Seidel coefficients (per-surface bar chart), footprint diagram, sag table (best-fit sphere and asphericity), glass map, wavefront map, Zernike coefficients (Fringe / Standard), FFT PSF, Huygens PSF and Huygens MTF (tilted / curved image plane), encircled energy, relative illumination, image simulation, 2D / 3D layout
- Tolerance analysis:
tol/complines write the tolerances and compensators; sensitivity (per-item upper and lower limits, compensator re-optimization, ranking by impact, root-sum-square combination, tornado chart) and Monte Carlo (mean, standard deviation, percentiles, histogram + cumulative yield curve, identical results for the same random seed); the criterion is RMS spot size or RMS wavefront - Version comparison (first-order quantities, prescription differences and image quality of any two versions side by side), the expression calculator
calc(MATLAB style, can call operands directly) - The report pack (publication-quality figures + numbers pages + prescription / first-order / acceptance / manufacturability tables + deterministic conclusions) and numerical checking of report drafts
- Every figure carries a frame (lens, field, wavelength, evidence id) and a numbers page; export to PNG (300 dpi) / SVG / PDF
- Every result carries an evidence id (model, engine, sampling parameters), so reported numbers are traceable
Optimization and acceptance
- Merit function (Zemax operand names), default merit function, damped least-squares local optimization, Hammer global optimization; long tasks can run in the background, with progress and cancellation
- Intermediate quantities and expressions in the merit function (
let/op EXPR, MATLAB-style vector operations); variables can have upper and lower bounds; after optimization, model glass is replaced with the nearest catalog glass - Acceptance specs (spec) are kept separate from optimization targets, and
verifyrecomputes independently with fixed standard sampling and does not trust the improvement the optimizer reports about itself - Change log and rollback, and sign-off (only a person can sign; the AI cannot sign on anyone's behalf)
Interchange and entry points
- Zemax
.zmximport and export (sequential mode, UTF-8 / UTF-16, units such as inches converted to mm): the embedded merit function, multi-configuration data and tolerances round-trip together; single-surface decenter/tilt is expanded into coordinate breaks on import; on export, a table of "the numbers you should see in Zemax" is attached alongside. A merit function can be imported on its own (LensBench's.mfor Zemax's text merit function), and can also be exported as an.mffor reuse in other lenses - The four entry points use the same command table: the desktop app (four workspaces: design / optimization / review / delivery), the command line
lb, MCP (through which AI clients do the work, with one-click config writing for the common clients), and Python (see Using LensBench from Python)
What it cannot do yet
Planned
- Other tolerance types such as surface irregularity
- Writing acceptance specs per configuration for multi-configuration designs (for now, multi-configuration acceptance only gives a verdict)
- Diffractive surfaces on mirrors (Binary 2 + MIRROR)
- Import and export of the remaining solves in
.zmx(angle / F-number / aplanatic / concentric solves on curvature, ±1× curvature pickups, pickups on thickness and marginal ray height / chief ray height / edge thickness solves, pickups on glass / conic / aspheric coefficients, and variables on curvature / thickness / conic / aspheric coefficients can already be imported and exported; position solves are frozen at their current value on export; other solves such as optical path difference, and pickups on semi-diameter, are taken at their current value on import) - Automatic update (for now, when a new version is available you download the new installer and reinstall; see Install)
Not doing at this stage
- Non-sequential (NSC), stray light and illumination
- Physical optics propagation (POP), polarization ray tracing
- Custom surfaces that depend on user DLLs (USERSURF), gradient index
- Surface apertures of other shapes such as elliptical and polygonal
- ISO 10110 engineering drawings, CAD export
Data and validation
- The manufacturer grade data shipped with the software comes from the public compilation at refractiveindex.info and is not the manufacturers' official catalogs; to match the manufacturers' latest catalogs exactly (including discontinued grades), use your own
.AGF(anagfline; for the same manufacturer it takes precedence over the bundled data). Zemax sample files are not distributed with the software - The item-by-item numerical comparison with Zemax already covers 3 designs and 33 items (first-order quantities, spot, MTF, Seidel and OPD of the Cooke triplet, plus the coordinate conventions of a fold mirror and a tilted plate), all within tolerance (see the validation report); more designs and analysis types are still being added. Beyond that, trust also comes from analytic golden references and from ray-by-ray reconciliation against an independent implementation