Optiland and RayCrafter (dev) vs Zemax

75 mm scan lens for the OrganGrinder: Optiland and RayCrafter (dev) against Zemax

A scan lens (the file's lens comments name LC1120-B, LB1106-B and an ACT508-200-B pair) for a 5.5 mm beam at 0.92 um, with the stop at the first surface: spherical surfaces, no tilts or fold mirror, one configuration, fields at 0, 5 and 11 degrees. Compared with our own Zemax run. RayCrafter (dev) matches on every row: focal length 73.36 mm and f/13.34 to rounding, its rays, chief rays, RMS spot and distortion to rounding, its Strehl ratios on Zemax's pixel grid within 0.0035, its MTF within 0.002, and its RMS wavefront against field within 0.001 waves (largest difference 0.00095 waves, so just inside the match limit). Optiland traces the same rays to rounding and gives the same OPD and Zernike coefficients, but its RMS spot against field is 55.1 % away (it weights the rings of the pupil equally, Zemax does not) and its RMS wavefront against field differs by up to 0.082 waves (it keeps piston and tilt); its Strehl ratios (0.0098 from Zemax's Huygens PSF with the glass's absorption divided out) and its largest grid distortion (3.100 % against 3.139 %) are Partial. Its distortion and field curvature analyses match Zemax at the primary wavelength, 0.92 um (until round 6's review they were read at the file's first wavelength, 0.78 um, which put its field curvature 0.12 mm off).

optiland 0.6.3 RayCrafter dev 5ecb2efd λ 0.78, 0.92, 1.064 µm Zemax OpticStudio 22.2.1 (file) EPD 5.5 mm fields 0, 5, 11° Zemax run 2026-12-04 13:38 Zemax 24.1.3 (our run)
Not working on this page

Every failing row of the tables below, against our own Zemax run.

System layout

Drawn from Optiland's surface positions and rays. The comparison with our own Zemax run is above.

Ray paths through the system
Light travels from left to right.
Optiland spot diagrams
Optiland's spot diagrams at the file's own fields.

Optiland against Zemax

Optiland 0.6.3, as released, with the file preparation and patches listed under "Optiland issues found". Nothing here uses RayCrafter. Each row is the largest difference from our own Zemax run (OpticStudio 24.1.3) over every galvo angle or field of every system below.

16matching
3partial
2failing

Not matching: partial and fail rows.

QuantityLargest difference from ZemaxMatch / partial withinResult
RMS spot against field, RmsSpotSizeVsField as it comesEqual weights on hexapolar rings count the pupil's edge too much, and only the rays that get through count55.1 %0.1 / 2 %Fail
RMS wavefront against field, RmsWavefrontErrorVsField as it comesA different meaning: piston and tilt are kept0.08196 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failFail
Strehl ratio, FFTPSF, glass absorption divided outAgainst Zemax's Huygens PSF, which prints three decimals and is itself a little above what Zemax's own wavefront gives0.0098250.005 / 0.02Partial
Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost0.016670.005 / 0.02Partial
Grid distortion, largestAfter a fold, x is read in global axes (issue 24)0.03891 percentage points0.005 / 0.05 percentage pointsPartial
All 21 rows, matches included
QuantityLargest difference from ZemaxMatch / partial withinResult
Refractive index of each glassN-BK7, N-SF57, N-SK22.22e−161e−06 / 0.0001Match
Position of every surface0 mm1e−09 / 1e−06 mmMatch
Rays at the image, ray by rayThe rays Zemax traced, every galvo angle or field4.33e−14 mm1e−06 / 0.001 mmMatch
Ray directions at the imageDirection cosines. Zemax's are reversed after an odd number of mirrors3.55e−151e−09 / 1e−06Match
Largest ray radius on every surface1.78e−14 mm1e−06 / 0.001 mmMatch
RMS spot of the same raysThe rays that get through, every one counted alike0 %0.1 / 2 %Match
Focal length, f-number, exit pupilSizes; Optiland's signs may differ after a mirror6.78e−05 %0.0001 / 0.1 %Match
OPD of every ray6.82e−09 waves0.001 / 0.01 wavesMatch
Zernike coefficients (37 standard)7.59e−09 waves0.001 / 0.01 wavesMatch
RMS spot against field, from Optiland's raysWith the pupil averaging Zemax uses (Gaussian quadrature)0 %0.1 / 2 %Match
RMS spot against field, RmsSpotSizeVsField as it comesEqual weights on hexapolar rings count the pupil's edge too much, and only the rays that get through count55.1 %0.1 / 2 %Fail
RMS wavefront against field, from Optiland's OPDPiston and tilt removed, as Zemax does1.78e−05 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failMatch
RMS wavefront against field, RmsWavefrontErrorVsField as it comesA different meaning: piston and tilt are kept0.08196 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failFail
Strehl ratio, FFTPSF, glass absorption divided outAgainst Zemax's Huygens PSF, which prints three decimals and is itself a little above what Zemax's own wavefront gives0.0098250.005 / 0.02Partial
Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost0.016670.005 / 0.02Partial
MTF, tangential and sagittal, every field0.0024210.005 / 0.02Match
Distortion, f-tan and f-theta3.37e−10 percentage points0.005 / 0.05 percentage pointsMatch
Grid distortion, largestAfter a fold, x is read in global axes (issue 24)0.03891 percentage points0.005 / 0.05 percentage pointsPartial
Field curvature, FieldCurvature as it comesAt the edge of the field0.000591 mm0.01 / 0.1 mmMatch
Field curvature, from Optiland's raysNear-axis rays of each beam, in the image surface's own axes0.000591 mm0.01 / 0.1 mmMatch
Seidel coefficients, sizesZemax prints six decimals. Optiland's signs may be opposite3.88e−07 mm1e−06 / 1e−05 mmMatch

RayCrafter against Zemax

This is RayCrafter's development branch

Tested at commit 5ecb2efd of dev, not the release on PyPI.

The rows below are on a system with a flat image.

12matching
0partial
0failing

Every row matches Zemax.

All 12 rows, matches included
QuantityLargest difference from ZemaxMatch / partial withinResult
Focal length and f-number4.22e−13 %0.0001 / 0.1 %Match
Chief ray at the image, every fieldFields where both programs block the chief ray are left out7.82e−14 mm1e−06 / 0.001 mmMatch
Ray fan (tangential), every fieldFields where no ray gets through are left out3.91e−14 mm1e−06 / 0.001 mmMatch
Ray fan: pupil points with a ray in one program only, every fieldLight that one program lets through and the other stops: vignetting that differs. Zemax draws a tangential fan point only if the ray one step lower in the pupil also gets through, so its window really starts one to two steps below its first point and ends up to one step above its last; a point where the edge may be is undecided and not counted (raycrafter #258); the sagittal fan is not compared (no vignetted sagittal reference to show Zemax does the same)0 %0 / 1 %Match
RMS spot against field0 %0.1 / 2 %Match
RMS wavefront against field0.000954 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failMatch
Strehl ratio, every fieldRayCrafter's Strehl ratio on the pixel grid of Zemax's Huygens PSF, as Zemax reads its own (its largest pixel); Zemax's prints three decimals0.003540.005 / 0.02Match
MTF plot (one wavelength)0.001570.005 / 0.02Match
Distortion, f-tan and f-theta3.05e−08 percentage points0.005 / 0.05 percentage pointsMatch
Grid distortion, largest1.8e−07 percentage points0.005 / 0.05 percentage pointsMatch
Field curvatureRayCrafter takes the best focus of a whole fan, Zemax that of rays near the chief ray. Signs are opposite by convention0.000555 mm0.01 / 0.1 mmMatch
Field curvature, change from the axis0.000555 mm0.01 / 0.1 mmMatch
What RayCrafter said when it imported the file
  • Each field angle was loaded at the primary wavelength, and each other wavelength as an on-axis field.

Optiland: the file's own fields

Against field angle. Blue: from Optiland's rays and OPD with Zemax's meaning. Orange: Optiland's own analysis as it comes, where it differs.
Against field angle. Blue: from Optiland's rays and OPD with Zemax's meaning. Orange: Optiland's own analysis as it comes, where it differs.
Optiland only (not RayCrafter): MTF and a section of the Huygens PSF (scaled to its peak) at three fields.
Optiland only (not RayCrafter): MTF and a section of Optiland's Huygens PSF (scaled to its peak) at three fields, against Zemax's. RayCrafter's PSF against the same Zemax PSF is in its own figure.

RayCrafter: its own plots

What RayCrafter's window and report draw, with Zemax's points over them (open markers), on the file's own fields.

RMS spot radius against field angle.
RMS spot radius against field angle.
Strehl ratio and RMS wavefront against field angle.
Strehl ratio and RMS wavefront against field angle.
Distortion, f-tan and f-theta.
Distortion, f-tan and f-theta.
Field curvature. Zemax's sign is turned only after an odd number of mirrors, which reverses its z (the legend says where).
Field curvature. Zemax's sign is turned only after an odd number of mirrors, which reverses its z (the legend says where).
MTF (one wavelength), first field.
MTF (one wavelength), first field.
MTF (one wavelength), second field.
MTF (one wavelength), second field.
MTF (one wavelength), middle field.
MTF (one wavelength), middle field.
RayCrafter's PSF against Zemax's Huygens PSF, a section through each peak.
RayCrafter's PSF against Zemax's Huygens PSF: a section along y through each peak, scaled to its peak, in µm from the chief ray's image. RayCrafter's PSF is on Zemax's own pixel grid (Bench.psf with pixel_um) and both are centred on the chief ray's image (Zemax's "Center coordinates" in the Huygens PSF header are its chief ray's). The dashed line is RayCrafter with every ray at the same amplitude, as Zemax's Huygens PSF sums them: it shows why RayCrafter's own PSF, which weights the rays to conserve energy, can be a little wider; it is not a PSF a user gets. Peak positions agree to within 0.07 µm (a Zemax pixel is 1 µm) and the FWHM to within 0.6 % (0.6 % with equal amplitudes). Not scored: the Strehl ratio rows already score the height of the peak; position and width are shown for the eye.

Semi-diameters stored in the file

Zemax stores, for every surface whose semi-diameter is automatic, the largest ray radius it computed. We re-trace the file in Optiland and take the largest local ray radius. Status is computed from the tolerances in comparison.json: match within 0.5%, partial within 5%.

2matching
0partial
0failing

Every row matches Zemax.

All 2 rows, matches included
QuantityZemaxOptilandDifferenceResult
Semi-diameter, surface 1 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax)2.75002.75000.00%Match
Semi-diameter, surface 12 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax)13.883013.88300.00%Match

Lens data

Prescription as stored in the Zemax file. The Optiland radius is read back from the loaded model, so a difference would show an import error.

Zemax #CommentTypeRadius, Zemax (mm)Radius, Optiland (mm)Thickness (mm)GlassSemi-diameter (mm)Clear aperture (mm)
0STANDARD∞∞∞0
1STANDARD (stop)∞∞182.75
2STANDARD∞∞4N-BK712.7 (fixed)12.7
3LC1120-BSTANDARD51.4651.4630.112.7 (fixed)12.7
4LB1106-BSTANDARD127.37127.378.12N-BK725.4 (fixed)25.4
5not too criticalSTANDARD-127.37-127.37225.4 (fixed)25.4
6STANDARD422.363422.3635N-SF5725.4 (fixed)25.4
7STANDARD118.656118.6568.2N-SK225.4 (fixed)25.4
8ACT508-200-BSTANDARD-121.012-121.0121.1225.4 (fixed)25.4
9ACT508-200-BSTANDARD121.012121.0128.2N-SK225.4 (fixed)25.4
10STANDARD-118.656-118.6565N-SF5725.4 (fixed)25.4
11STANDARD-422.363-422.3638825.4 (fixed)25.4
12STANDARD∞∞013.883

How Zemax was run

By make_zemax_reference.py, the same way for every design, on 2026-12-04 13:38. What is asked for, and which tool each result tests, is in zemax_analyses.md; every file is in Zemax_reference_output.

SystemWhat it isTests
The file's own fieldsThe file untouched, at its own fieldsOptiland, RayCrafter

Reproduce

uv run python -m evaluation_tools.from_zemax.analyze_zmx designs/from_zemax/organgrinder_75mm_scan_lens
uv run python -m evaluation_tools.from_zemax.compare_optiland designs/from_zemax/organgrinder_75mm_scan_lens     # needs Zemax_reference_output/
uv run python -m evaluation_tools.from_zemax.compare_raycrafter designs/from_zemax/organgrinder_75mm_scan_lens
uv run python -m evaluation_tools.build_summary                    # regenerates all HTML