Optiland and RayCrafter (dev) vs Zemax
Scan and tube lens, 8 May 2024 (6 mm beam, fold mirror, ideal 12.5 mm objective): Optiland and RayCrafter (dev) against Zemax
A variant of the SMOD4.5 scan system, compared with our own Zemax run: a collimated 6 mm beam, a scan lens (comments name AC508-100-B and LE1015-B), a 190 mm gap with an empty surface in it, a tube lens of two ACT508-400-B doublets back to back, a 45 degree fold mirror (coordinate breaks) and an ideal 12.5 mm objective. It is very fast (f/0.70, image-side NA about 0.58), has four wavelengths (0.8, 0.95, 1.0 and 1.04 um, primary 0.8) and fields at 0, 1, 2, 3 and 6 degrees (the file lists three more at 0 degrees; they repeat the on-axis field and are ignored, Rob's decision). RayCrafter (dev) matches on 10 rows: its rays, chief rays, RMS spot against field, Strehl ratios on Zemax's pixel grid (within 0.0015), distortion and field curvature agree to rounding or within the match limits. Its MTF is not scored ("not comparable"): at this NA Zemax's FFT and Huygens MTFs differ by 0.115 to 0.118 at every field, as the pupil's ray density varies 2.10 to 2.36 times, and RayCrafter lies 0.005 outside the band between them (0.053 to 0.055 from the FFT MTF, 0.063 to 0.064 from the Huygens MTF), within the fail limit of it. The RMS wavefront against field is Partial, 0.0038 waves from Zemax at its largest (at 6 degrees, 0.0703 against 0.0665 waves, 5.7 %), a difference that grows with the field. Optiland traces Zemax's rays to rounding and agrees with the semi-diameters Zemax stored on the fold mirror (19.6875 mm) and image (0.4401 mm against 0.4405), but after the fold mirror its paraxial exit pupil is wrong (94.83 mm from the image and 99.89 mm across, against Zemax's 5.74 and 8.21 mm, which Optiland gives on the file unfolded: issue 2), and behind the ideal objective its OPD grows with the field, to 86 waves at 6 degrees (issue 3). So its first-order, OPD, Zernike, RMS wavefront, Strehl, MTF, distortion and Seidel rows Fail; its distortion analyses give no number (grid distortion fails with an error, a zero-size array). Its RMS spot from its own rays matches; RmsSpotSizeVsField as it comes fails, as on the other designs (equal weights on the rings).
Zemax's own two methods (FFT and Huygens) disagree with each other by more than our fail limit. The rows below keep their verdicts, each against one Zemax number. Where RayCrafter lies inside the band between Zemax's two numbers it is no further from either than they are from each other; where it lies outside, it is further from both than Zemax's own methods are from each other. Each row's note and Zemax against itself give both Zemax numbers, their difference and RayCrafter's value.
- MTF. Zemax's FFT MTF and its Huygens MTF differ by up to 0.118 (at 3 deg), 5.9 times our fail limit of 0.02. Taking every frequency, RayCrafter's MTF is beside the band (outside it by up to the fail limit of 0.02) at 0 deg, 1 deg, 2 deg, 3 deg, 6 deg, the band being the range between Zemax's two curves. Plots with both Zemax curves, the band and RayCrafter's: 2 deg.
- RMS wavefront. Zemax gives one number per field, so there is no Zemax spread to show for it.
- Optiland: Focal length, f-number, exit pupil, differs by 1553 %
- Optiland: OPD of every ray, differs by 86.06 waves
- Optiland: Zernike coefficients (37 standard), differs by 26.49 waves
- Optiland: RMS spot against field, RmsSpotSizeVsField as it comes, differs by 20.12 %
- Optiland: RMS wavefront against field, from Optiland's OPD, differs by 8.434 waves
- Optiland: RMS wavefront against field, RmsWavefrontErrorVsField as it comes, differs by 31.01 waves
- Optiland: Strehl ratio, FFTPSF, glass absorption divided out, differs by 0.961
- Optiland: Strehl ratio, FFTPSF as it comes, differs by 0.9611
- Optiland: MTF, tangential and sagittal, every field, differs by 0.9695
- Optiland: Distortion, f-tan and f-theta, gives no number (Optiland gives no number (issue 2))
- Optiland: Grid distortion, largest, gives no number (ValueError: zero-size array to reduction operation maximum which has no identity (issue 2))
- Optiland: Seidel coefficients, sizes, differs by 0.00038 mm
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.


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.
Not matching: partial and fail rows.
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Focal length, f-number, exit pupilSizes; Optiland's signs may differ after a mirror | 1553 % | 0.0001 / 0.1 % | Fail |
| OPD of every ray | 86.06 waves | 0.001 / 0.01 waves | Fail |
| Zernike coefficients (37 standard) | 26.49 waves | 0.001 / 0.01 waves | Fail |
| 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 count | 20.12 % | 0.1 / 2 % | Fail |
| RMS wavefront against field, from Optiland's OPDPiston and tilt removed, as Zemax does | 8.434 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| RMS wavefront against field, RmsWavefrontErrorVsField as it comesA different meaning: piston and tilt are kept | 31.01 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| 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 gives | 0.961 | 0.005 / 0.02 | Fail |
| Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost | 0.9611 | 0.005 / 0.02 | Fail |
| MTF, tangential and sagittal, every field | 0.9695 | 0.005 / 0.02 | Fail |
| Distortion, f-tan and f-thetaOptiland gives no number (issue 2) | none percentage points | 0.005 / 0.05 percentage points | Fail |
| Grid distortion, largestValueError: zero-size array to reduction operation maximum which has no identity (issue 2) | fails | Fail | |
| Seidel coefficients, sizesZemax prints six decimals. Optiland's signs may be opposite | 0.00038 mm | 1e−06 / 1e−05 mm | Fail |
All 21 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Refractive index of each glassN-SF6HT, N-LAK22, N-BK7, N-SF5, N-SK2 | 2.22e−16 | 1e−06 / 0.0001 | Match |
| Position of every surface | 1.27e−13 mm | 1e−09 / 1e−06 mm | Match |
| Rays at the image, ray by rayThe rays Zemax traced, every galvo angle or field | 5.62e−14 mm | 1e−06 / 0.001 mm | Match |
| Ray directions at the imageDirection cosines. Zemax's are reversed after an odd number of mirrors | 6.47e−15 | 1e−09 / 1e−06 | Match |
| Largest ray radius on every surface | 3.61e−14 mm | 1e−06 / 0.001 mm | Match |
| RMS spot of the same raysThe rays that get through, every one counted alike | 0 % | 0.1 / 2 % | Match |
| Focal length, f-number, exit pupilSizes; Optiland's signs may differ after a mirror | 1553 % | 0.0001 / 0.1 % | Fail |
| OPD of every ray | 86.06 waves | 0.001 / 0.01 waves | Fail |
| Zernike coefficients (37 standard) | 26.49 waves | 0.001 / 0.01 waves | Fail |
| 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 count | 20.12 % | 0.1 / 2 % | Fail |
| RMS wavefront against field, from Optiland's OPDPiston and tilt removed, as Zemax does | 8.434 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| RMS wavefront against field, RmsWavefrontErrorVsField as it comesA different meaning: piston and tilt are kept | 31.01 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| 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 gives | 0.961 | 0.005 / 0.02 | Fail |
| Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost | 0.9611 | 0.005 / 0.02 | Fail |
| MTF, tangential and sagittal, every field | 0.9695 | 0.005 / 0.02 | Fail |
| Distortion, f-tan and f-thetaOptiland gives no number (issue 2) | none percentage points | 0.005 / 0.05 percentage points | Fail |
| Grid distortion, largestValueError: zero-size array to reduction operation maximum which has no identity (issue 2) | fails | Fail | |
| Field curvature, FieldCurvature as it comesAt the edge of the field | 0.00084 mm | 0.01 / 0.1 mm | Match |
| Field curvature, from Optiland's raysNear-axis rays of each beam, in the image surface's own axes | 7.35e−07 mm | 0.01 / 0.1 mm | Match |
| Seidel coefficients, sizesZemax prints six decimals. Optiland's signs may be opposite | 0.00038 mm | 1e−06 / 1e−05 mm | Fail |
RayCrafter against Zemax
Tested at commit 5ecb2efd of dev, not the release on PyPI.
The rows below are on a system with a flat image.
Not matching: partial and fail rows.
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| RMS wavefront against fieldZemax gives one RMS wavefront number per field (its RMS Wavefront operand), so there is no Zemax spread to show for this row: it compares that one number with RayCrafter's | 0.003815 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Partial |
All 11 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Focal length and f-number | 1.89e−13 % | 0.0001 / 0.1 % | Match |
| Chief ray at the image, every fieldFields where both programs block the chief ray are left out | 2.66e−15 mm | 1e−06 / 0.001 mm | Match |
| Ray fan (tangential), every fieldFields where no ray gets through are left out | 5.33e−15 mm | 1e−06 / 0.001 mm | Match |
| 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 field | 0 % | 0.1 / 2 % | Match |
| RMS wavefront against fieldZemax gives one RMS wavefront number per field (its RMS Wavefront operand), so there is no Zemax spread to show for this row: it compares that one number with RayCrafter's | 0.003815 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Partial |
| 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 decimals | 0.001458 | 0.005 / 0.02 | Match |
| Distortion, f-tan and f-theta | 6.93e−09 percentage points | 0.005 / 0.05 percentage points | Match |
| Grid distortion, largest | 4.8e−07 percentage points | 0.005 / 0.05 percentage points | Match |
| Field curvatureRayCrafter takes the best focus of a whole fan, Zemax that of rays near the chief ray. Signs are opposite by convention | 7.34e−07 mm | 0.01 / 0.1 mm | Match |
| Field curvature, change from the axis | 7.34e−07 mm | 0.01 / 0.1 mm | Match |
MTF plot (one wavelength), fields where Zemax's two MTF methods weight the pupil differently: Not scored at 0 deg, 1 deg, 2 deg, 3 deg, 6 deg: Zemax's FFT and Huygens MTFs weight the pupil differently, so neither is a reference. The FFT MTF takes the pupil as evenly bright in direction cosine (a weight J^0, J being the area of direction-cosine space that a unit of the pupil goes to), the Huygens MTF gives every ray the same amplitude (J^-1), and conservation of energy gives J^-1/2, which RayCrafter now follows (raycrafter #236); a correct RayCrafter lies between the two. The rule: the two Zemax MTFs differ by more than 0.04 (twice the fail limit, so that a RayCrafter halfway between them is outside the limit of both) and the pupil's ray density, from Zemax's own rays, varies by more than 1.3 times (below that the weighting cannot account for a gap of 0.04), RayCrafter lies between the two curves or within the fail limit of them (outside that it is scored), and the field's Strehl ratio does not fail (a wavefront that differs is scored: an error that kept RayCrafter's MTF between two curves this far apart would show there). All three curves are in the MTF plots. At each field: 0 deg: Zemax's FFT and Huygens MTFs differ by 0.117; ray density varies 2.10 times; RayCrafter differs from the FFT MTF by 0.053 and from the Huygens MTF by 0.064, 0.005 outside the band between them; 1 deg: Zemax's FFT and Huygens MTFs differ by 0.117; ray density varies 2.14 times; RayCrafter differs from the FFT MTF by 0.054 and from the Huygens MTF by 0.064, 0.005 outside the band between them; 2 deg: Zemax's FFT and Huygens MTFs differ by 0.118; ray density varies 2.19 times; RayCrafter differs from the FFT MTF by 0.054 and from the Huygens MTF by 0.064, 0.005 outside the band between them; 3 deg: Zemax's FFT and Huygens MTFs differ by 0.118; ray density varies 2.23 times; RayCrafter differs from the FFT MTF by 0.055 and from the Huygens MTF by 0.063, 0.005 outside the band between them; 6 deg: Zemax's FFT and Huygens MTFs differ by 0.115; ray density varies 2.36 times; RayCrafter differs from the FFT MTF by 0.055 and from the Huygens MTF by 0.063, 0.005 outside the band between them. Zemax's own FFT and Huygens MTFs differ by more than the fail limit (0.02) at 0 deg, 1 deg, 2 deg, 3 deg, 6 deg, so matching Zemax is a band, not a line (zemax-spread). 0 deg: at 296 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.729, Zemax Huygens 0.611 (they differ by 0.117, 5.9 times the fail limit), RayCrafter 0.675: inside the band, 0.053 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.005 outside the band; 1 deg: at 296 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.729, Zemax Huygens 0.612 (they differ by 0.117, 5.9 times the fail limit), RayCrafter 0.676: inside the band, 0.054 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.005 outside the band; 2 deg: at 301 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.727, Zemax Huygens 0.609 (they differ by 0.118, 5.9 times the fail limit), RayCrafter 0.673: inside the band, 0.054 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.005 outside the band; 3 deg: at 301 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.729, Zemax Huygens 0.611 (they differ by 0.118, 5.9 times the fail limit), RayCrafter 0.675: inside the band, 0.055 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.005 outside the band; 6 deg: at 291 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.728, Zemax Huygens 0.612 (they differ by 0.115, 5.8 times the fail limit), RayCrafter 0.675: inside the band, 0.053 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.005 outside the band
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.
- The fold mirror at surface 15 has no aperture, only a semi-diameter of 19.6875 mm, at which Zemax does not block rays. It is round and was enlarged to 41.4 mm across so that none of the file's own rays is blocked.
Zemax against itself
Where Zemax's own two methods disagree by more than the fail limit, a single Zemax number is not what RayCrafter should match. Both Zemax numbers are shown here and in the plots, with RayCrafter's. No tolerance or verdict is changed by this section. RMS wavefront against field has one Zemax number only, so there is nothing to spread for it.
MTF: FFT against Huygens
Zemax computes the MTF two ways. The values are at the spatial frequency where its two curves differ most (the worse azimuth). RayCrafter is inside the band when it lies between the two Zemax values, beside it when it is outside by up to the fail limit (0.02), and outside it beyond that; the last column is the largest such distance over all frequencies. The band is shaded in the plots.
| Field | At (cycles/mm) | Zemax FFT MTF | Zemax Huygens MTF | Zemax's own difference | RayCrafter MTF | RayCrafter against the band there | Largest distance outside the band, all frequencies |
|---|---|---|---|---|---|---|---|
| 0 deg | 296 | 0.729 | 0.611 | 0.117 | 0.675 | inside the band, 0.053 from the nearer Zemax value | 0.005 |
| 1 deg | 296 | 0.729 | 0.612 | 0.117 | 0.676 | inside the band, 0.054 from the nearer Zemax value | 0.005 |
| 2 deg | 301 | 0.727 | 0.609 | 0.118 | 0.673 | inside the band, 0.054 from the nearer Zemax value | 0.005 |
| 3 deg | 301 | 0.729 | 0.611 | 0.118 | 0.675 | inside the band, 0.055 from the nearer Zemax value | 0.005 |
| 6 deg | 291 | 0.728 | 0.612 | 0.115 | 0.675 | inside the band, 0.053 from the nearer Zemax value | 0.005 |

Optiland: the file's own fields


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.







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%.
Every row matches Zemax.
All 3 rows, matches included
| Quantity | Zemax | Optiland | Difference | Result |
|---|---|---|---|---|
| Semi-diameter, surface 7 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 7.0234 | 7.0257 | 0.03% | Match |
| Semi-diameter, surface 15 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 19.6875 | 19.6875 | 0.00% | Match |
| Semi-diameter, surface 18 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 0.4401 | 0.4405 | 0.10% | 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 # | Comment | Type | Radius, Zemax (mm) | Radius, Optiland (mm) | Thickness (mm) | Glass | Semi-diameter (mm) | Clear aperture (mm) |
|---|---|---|---|---|---|---|---|---|
| 0 | STANDARD | ∞ | ∞ | ∞ | 0 | |||
| 1 | STANDARD (stop) | ∞ | ∞ | 56 | 2 (fixed) | |||
| 2 | STANDARD | 280.55 | 280.55 | 2 | N-SF6HT | 25.4 (fixed) | 25.4 | |
| 3 | STANDARD | 55.98 | 55.98 | 13 | N-LAK22 | 25.4 (fixed) | 25.4 | |
| 4 | AC508-100-B | STANDARD | -65.77 | -65.77 | 2 | 25.4 (fixed) | 25.4 | |
| 5 | LE1015-B | STANDARD | 65.16 | 65.16 | 6.18 | N-BK7 | 25.4 (fixed) | 25.4 |
| 6 | STANDARD | 171.6 | 171.6 | 60.3 | 25.4 (fixed) | 25.4 | ||
| 7 | STANDARD | ∞ | ∞ | 190.3 | 7.023 | |||
| 8 | STANDARD | -2290.924 | -2290.924 | 6 | N-SF5 | 25.4 (fixed) | 25.4 | |
| 9 | STANDARD | 152.806 | 152.806 | 8 | N-SK2 | 25.4 (fixed) | 25.4 | |
| 10 | ACT508-400-B | STANDARD | -189.767 | -189.767 | 1 | 25.4 (fixed) | 25.4 | |
| 11 | ACT508-400-B | STANDARD | 189.767 | 189.767 | 8 | N-SK2 | 25.4 (fixed) | 25.4 |
| 12 | STANDARD | -152.806 | -152.806 | 6 | N-SF5 | 25.4 (fixed) | 25.4 | |
| 13 | STANDARD | 2290.924 | 2290.924 | 53.33 | 25.4 (fixed) | 25.4 | ||
| 15 | STANDARD | ∞ | ∞ | 0 | MIRROR | 19.687 | ||
| 17 | PARAXIAL | ∞ | ∞ | -12.5 | 10 (fixed) | |||
| 18 | STANDARD | ∞ | ∞ | 0 | 0.44 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-04 14:21.
What is asked for, and which tool each result tests, is in
zemax_analyses.md; every file is in
Zemax_reference_output.
| System | What it is | Tests |
|---|---|---|
| The file's own fields | The file untouched, at its own fields | Optiland, RayCrafter |
Reproduce
uv run python -m evaluation_tools.from_zemax.analyze_zmx designs/from_zemax/scan_and_tube_lens_20240508 uv run python -m evaluation_tools.from_zemax.compare_optiland designs/from_zemax/scan_and_tube_lens_20240508 # needs Zemax_reference_output/ uv run python -m evaluation_tools.from_zemax.compare_raycrafter designs/from_zemax/scan_and_tube_lens_20240508 uv run python -m evaluation_tools.build_summary # regenerates all HTML