RayCrafter (dev) vs Zemax

SMOD4.5 folded, exported by RayCrafter: RayCrafter (dev) against Zemax

A folded Zemax design read by RayCrafter and exported again. The mirror, rays, spots and field curvature are as in Zemax. Not all matches: the RMS wavefront at large fields (0.0107 waves, 6 % low at the largest) and, at 10 deg, the Strehl ratio (0.356 against Zemax's 0.308, which its own wavefront map also gives) fail, and so does the MTF at 10 deg: it differs from Zemax's Huygens MTF by 0.127 and from its FFT MTF by 0.084, and lies 0.053 outside the band between them. At 0, 5, 6.5 and 7 deg the MTF is not comparable and not scored. Zemax's own two MTFs differ from each other by 0.149 to 0.154 there, even on the aberration-free axis, because the ideal objective follows the tangent law at NA 0.64 and the density of rays in direction cosine varies 2.6 to 2.7 times across the pupil: Zemax's FFT MTF takes the pupil as evenly bright, its Huygens MTF weights every ray alike and so over-weights the rim, and conservation of energy, which RayCrafter's MTF follows since raycrafter #236, is between them. RayCrafter's MTF lies between Zemax's two curves at those fields (at most 0.010 outside), so neither verdict is a measure of an error; all three curves are in the plots. At 10 deg RayCrafter is outside the band by more than the limit, and the Strehl ratio fails there too, so that Fail is RayCrafter's own.

Zemax disagrees with itself here, so "matching Zemax" is not well defined

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.172 (at 10 deg), 8.6 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, 5 deg, 6.5 deg, 7 deg; outside the band (by more than 0.02) at 10 deg, the band being the range between Zemax's two curves. Plots with both Zemax curves, the band and RayCrafter's: 10 deg.
  • Strehl ratio. Here Zemax's own numbers agree with each other (Huygens PSF against Wavefront Map, within 0.02 at every field), so a Strehl ratio that does not match is not explained by Zemax's spread: RayCrafter's is beside the band (outside it by up to the fail limit of 0.02) at 0 deg, 5 deg, 6.5 deg, 7 deg; outside the band (by more than 0.02) at 10 deg.
  • RMS wavefront. Zemax gives one number per field, so there is no Zemax spread to show for it.
RayCrafter dev 5ecb2efd Zemax 24.1.3 λ 0.85 µm Zemax run 2026-12-04 13:34
Not working on this page

RayCrafter now measures the phase about the exit pupil's sphere (raycrafter #199): the RMS wavefront on the axis agrees (0.0084 against 0.0085 waves, where it was 0.0118), and the Strehl ratio and MTF are closer. The RMS wavefront is below Zemax's at every field, by 1 % on the axis, growing to 5.2 % at 9 deg (0.126 against 0.133 waves) and 6.4 % at 10 deg (0.156 against 0.167 waves, a difference of 0.0107 waves), which fails the row. The cause is not yet established.

MTF: Zemax's FFT MTF takes the pupil index as linear in the direction cosine and its own rays here depart from that (plane-fit residual 0.068 on the axis, 0.075 at 7 deg and 0.092 at 10 deg, against 0.005): evaluation #86. Its Huygens MTF is on a window of 183 um (512 samples of 0.36 um) with a frequency step of 5.5 cycles/mm, and the spots (0.7 to 6.3 um) are far smaller than the window, so it passes the trust rule (huygens_trust.py: step at most 10 cycles/mm, window at least twice the spot). It gives every ray of its pupil grid the same amplitude, so it weights the pupil by the density of rays in direction cosine; Zemax's own rays follow the tangent law (tan of the ray angle over the pupil radius is 0.8247 to 7e-4, NA 0.636), so that density varies 2.6 to 2.9 times across the pupil. The FFT MTF weights the pupil evenly and energy conservation by the square root of the density, which RayCrafter's MTF now does (raycrafter #236): the two Zemax curves bracket it, 0.149 to 0.172 apart at every field, including the axis, where the Strehl ratio is 0.997 in Zemax and RayCrafter. The rule (tolerances.py, PUPIL_DENSITY_SPREAD): where Zemax's two MTFs differ by more than twice the fail limit and the density varies by more than 1.3 times (the weighting alone then moves the MTF by more than the fail limit), a field whose RayCrafter MTF lies between them is not comparable. At 0, 5, 6.5 and 7 deg it does (0.003 to 0.010 outside the band), so those rows are not scored; at 10 deg RayCrafter is 0.037 (tangential) and 0.053 (sagittal) outside it, over the limit of 0.02, which is Fail, and the Strehl ratio and the wavefront also differ there (raycrafter #199 found the same).

Strehl ratio at 10 deg, 0.356 against 0.308: Zemax's exit pupil position is positive (+76.4 mm), but the sign of the reference sphere makes no difference to its grid there (0.042 either way), and Zemax's Huygens PSF and its own wavefront map agree (0.308). The Strehl row is therefore a difference of RayCrafter's, and fails (evaluation #84).

The design

SMOD4.5 imported into RayCrafter with its fold mirror and exported again: five angles at 850 nm. The ideal objective is widened to 50 mm.

Zemax: seen from the side (z right, y up).
Zemax: seen from the side (z right, y up).
RayCrafter's own ray diagram.
RayCrafter's own ray diagram.

What is tested

A folded Zemax file read and written again by RayCrafter. The design as authored is on the SMOD4.5 page.

Issue: raycrafter #159.

RayCrafter against Zemax

This is RayCrafter's development branch

RayCrafter at commit 5ecb2efd of dev, not the release on PyPI. The .zmx was exported at d5d3377b.

RayCrafter opens the project itself; Zemax (OpticStudio 24.1.3) the .zmx RayCrafter exported from it. So a difference may be in the export, in a calculation, or in what a quantity means. Each row is the largest difference over every field (0°, 5°, 6.5°, 7°, 10°).

22matching
1partial
4failing

Not matching: partial and fail rows.

QuantityLargest difference from ZemaxMatch / partial withinResult
RMS spot against focus, every fieldWhere the two ranges overlap1.872 % of the largest0.1 / 2 % of the largestPartial
RMS wavefront against fieldPiston and tilt removed; at the largest field, Zemax 0.1666 and RayCrafter 0.1561 waves. The design has an ideal (paraxial) lens, whose optical path each program works out in its own way. Zemax 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's0.01044 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failFail
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. RayCrafter's PSF weights each ray by sqrt(J), J being how far its part of the pupil spreads over direction cosine, so that energy is conserved (raycrafter #236); Zemax's Huygens PSF gives every ray the same amplitude. With every ray at the same amplitude RayCrafter's Strehl ratio is 0.7868 at 7 deg (0.0028 from Zemax's 0.784, against 0.0067 as it is); 0.3490 at 10 deg (0.0410 from Zemax's 0.308, against 0.0475 as it is). The row scores RayCrafter as it is. Zemax's own Strehl numbers agree with each other at every field (within the fail limit of 0.02), so a difference here is not Zemax's own spread. 0 deg: Zemax Huygens PSF 0.997, Zemax Wavefront Map 0.997 (they differ by 0.0002, within the fail limit of 0.02), RayCrafter 0.997: beside the band: 0.000 outside it, which is within the fail limit of 0.02; 5 deg: Zemax Huygens PSF 0.936, Zemax Wavefront Map 0.933 (they differ by 0.0025, within the fail limit of 0.02), RayCrafter 0.938: beside the band: 0.002 outside it, which is within the fail limit of 0.02; 6.5 deg: Zemax Huygens PSF 0.835, Zemax Wavefront Map 0.837 (they differ by 0.0022, within the fail limit of 0.02), RayCrafter 0.839: beside the band: 0.002 outside it, which is within the fail limit of 0.02; 7 deg: Zemax Huygens PSF 0.784, Zemax Wavefront Map 0.785 (they differ by 0.0005, within the fail limit of 0.02), RayCrafter 0.791: beside the band: 0.006 outside it, which is within the fail limit of 0.02; 10 deg: Zemax Huygens PSF 0.308, Zemax Wavefront Map 0.308 (they differ by 0.0001, within the fail limit of 0.02), RayCrafter 0.356: outside the band by 0.048, more than the fail limit of 0.020.04750.005 / 0.02Fail
MTF (one wavelength), other fieldsAt RayCrafter's own frequencies. Against Zemax's Huygens MTF, not its FFT MTF, at 10 deg: the FFT MTF takes the pupil index as linear in the direction cosine, and Zemax's own rays at the image depart from that by 0.092 (more than 0.005; a plane fit of L and M on px, py, over half their range), while the Huygens MTF follows the rays' own directions. It is not exact either: it gives every ray of its pupil grid the same amplitude, so where the density of rays in direction cosine varies across the pupil it weights the pupil by that density, where conservation of energy gives its square root (evaluation #86, https://github.com/raycrafter-optical-design/evaluation/issues/86). The difference from the Huygens MTF there is 0.127; from the FFT MTF, which is not scored there, 0.084. Zemax's own FFT and Huygens MTFs differ from each other by 0.172 at 10 deg (largest of the two azimuths). Zemax's own FFT and Huygens MTFs differ by more than the fail limit (0.02) at 0 deg, 5 deg, 6.5 deg, 7 deg, 10 deg, so matching Zemax is a band, not a line (zemax-spread). 0 deg: at 314 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.732, Zemax Huygens 0.582 (they differ by 0.150, 7.5 times the fail limit), RayCrafter 0.662: inside the band, 0.070 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 5 deg: at 295 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.726, Zemax Huygens 0.574 (they differ by 0.152, 7.6 times the fail limit), RayCrafter 0.656: inside the band, 0.071 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 6.5 deg: at 262 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.721, Zemax Huygens 0.567 (they differ by 0.153, 7.7 times the fail limit), RayCrafter 0.652: inside the band, 0.069 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.009 outside the band; 7 deg: at 248 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.718, Zemax Huygens 0.564 (they differ by 0.154, 7.7 times the fail limit), RayCrafter 0.650: inside the band, 0.068 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.010 outside the band; 10 deg: at 173 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.664, Zemax Huygens 0.492 (they differ by 0.172, 8.6 times the fail limit), RayCrafter 0.614: inside the band, 0.050 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.053 outside the band0.12710.005 / 0.02Fail
MTF (all wavelengths), other fieldsAt RayCrafter's own frequencies. Against Zemax's Huygens MTF, not its FFT MTF, at 10 deg: the FFT MTF takes the pupil index as linear in the direction cosine, and Zemax's own rays at the image depart from that by 0.092 (more than 0.005; a plane fit of L and M on px, py, over half their range), while the Huygens MTF follows the rays' own directions. It is not exact either: it gives every ray of its pupil grid the same amplitude, so where the density of rays in direction cosine varies across the pupil it weights the pupil by that density, where conservation of energy gives its square root (evaluation #86, https://github.com/raycrafter-optical-design/evaluation/issues/86). The difference from the Huygens MTF there is 0.127; from the FFT MTF, which is not scored there, 0.084. Zemax's own FFT and Huygens MTFs differ from each other by 0.172 at 10 deg (largest of the two azimuths). Zemax's FFT and Huygens MTFs are of one wavelength: the numbers against the band are in the note of the one-wavelength row and in the section on Zemax against itself0.12710.005 / 0.02Fail
All 27 rows, matches included
QuantityLargest difference from ZemaxMatch / partial withinResult
Zemax reads the aperture, fields, wavelength and afocal setting that were meant0 warnings0 / 0 warningsMatch
Surfaces: thicknesses, gaps and semi-diametersThe project file against the lens data Zemax holds0 mm1e−09 / 1e−06 mmMatch
Surfaces: curvatures and conicsCurvature in 1/mm01e−12 / 1e−09Match
Refractive index of each glassN-BK7, N-LAK22, N-SF1, N-SF5, N-SF6HT, N-SK22.22e−161e−06 / 0.0001Match
Fold mirrors (1): distance along the light5.68e−14 mm1e−09 / 1e−06 mmMatch
Fold mirrors: half widths of the outlineAgainst the apertures Zemax holds (Zemax_layouts/layouts.json)0 mm1e−09 / 1e−06 mmMatch
Rays at the image, ray by ray: positionThe rays that both programs trace and get through: 469 at 0, 469 at 5, 469 at 6.5, 469 at 7, 469 at 105.69e−15 mm1e−06 / 0.001 mmMatch
Rays at the image, ray by ray: slopedx/dz and dy/dz. The design has ideal (paraxial) lenses, which each program bends rays through in its own way1.13e−141e−08 / 1e−05Match
Share of the pupil's rays that get through the aperturesRayCrafter's vignetting analysis against the range that Zemax's rings of rays allow: at 0, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (469 of 469 rays through); at 5, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (469 of 469 rays through); at 6.5, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (469 of 469 rays through); at 7, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (469 of 469 rays through); at 10, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (469 of 469 rays through)0 % points0.5 / 2 % pointsMatch
Chief ray at the image, every field3.64e−15 mm1e−06 / 0.001 mmMatch
Focal length and f-numberCompares Zemax's image-space F/# with RayCrafter's f-number, which is the focal length over the diameter of the beam that gets through; for an unclipped beam that is the same quantity, so the two agree to rounding (they differ only where a rim clips the beam, as on clipped_negative_lens, where it is recorded, not scored)0 %0.0001 / 0.1 %Match
RMS spot radius, every fieldZemax by Gaussian quadrature, RayCrafter from its spot diagram0 %0.1 / 2 %Match
Ray fans, tangential and sagittal7.19e−15 mm1e−06 / 0.001 mmMatch
RMS spot against focus, every fieldWhere the two ranges overlap1.872 % of the largest0.1 / 2 % of the largestPartial
RMS spot against fieldFrom the axis to the largest field, 21 angles0 %0.1 / 2 %Match
RMS wavefront against fieldPiston and tilt removed; at the largest field, Zemax 0.1666 and RayCrafter 0.1561 waves. The design has an ideal (paraxial) lens, whose optical path each program works out in its own way. Zemax 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's0.01044 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failFail
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. RayCrafter's PSF weights each ray by sqrt(J), J being how far its part of the pupil spreads over direction cosine, so that energy is conserved (raycrafter #236); Zemax's Huygens PSF gives every ray the same amplitude. With every ray at the same amplitude RayCrafter's Strehl ratio is 0.7868 at 7 deg (0.0028 from Zemax's 0.784, against 0.0067 as it is); 0.3490 at 10 deg (0.0410 from Zemax's 0.308, against 0.0475 as it is). The row scores RayCrafter as it is. Zemax's own Strehl numbers agree with each other at every field (within the fail limit of 0.02), so a difference here is not Zemax's own spread. 0 deg: Zemax Huygens PSF 0.997, Zemax Wavefront Map 0.997 (they differ by 0.0002, within the fail limit of 0.02), RayCrafter 0.997: beside the band: 0.000 outside it, which is within the fail limit of 0.02; 5 deg: Zemax Huygens PSF 0.936, Zemax Wavefront Map 0.933 (they differ by 0.0025, within the fail limit of 0.02), RayCrafter 0.938: beside the band: 0.002 outside it, which is within the fail limit of 0.02; 6.5 deg: Zemax Huygens PSF 0.835, Zemax Wavefront Map 0.837 (they differ by 0.0022, within the fail limit of 0.02), RayCrafter 0.839: beside the band: 0.002 outside it, which is within the fail limit of 0.02; 7 deg: Zemax Huygens PSF 0.784, Zemax Wavefront Map 0.785 (they differ by 0.0005, within the fail limit of 0.02), RayCrafter 0.791: beside the band: 0.006 outside it, which is within the fail limit of 0.02; 10 deg: Zemax Huygens PSF 0.308, Zemax Wavefront Map 0.308 (they differ by 0.0001, within the fail limit of 0.02), RayCrafter 0.356: outside the band by 0.048, more than the fail limit of 0.020.04750.005 / 0.02Fail
MTF (one wavelength), other fieldsAt RayCrafter's own frequencies. Against Zemax's Huygens MTF, not its FFT MTF, at 10 deg: the FFT MTF takes the pupil index as linear in the direction cosine, and Zemax's own rays at the image depart from that by 0.092 (more than 0.005; a plane fit of L and M on px, py, over half their range), while the Huygens MTF follows the rays' own directions. It is not exact either: it gives every ray of its pupil grid the same amplitude, so where the density of rays in direction cosine varies across the pupil it weights the pupil by that density, where conservation of energy gives its square root (evaluation #86, https://github.com/raycrafter-optical-design/evaluation/issues/86). The difference from the Huygens MTF there is 0.127; from the FFT MTF, which is not scored there, 0.084. Zemax's own FFT and Huygens MTFs differ from each other by 0.172 at 10 deg (largest of the two azimuths). Zemax's own FFT and Huygens MTFs differ by more than the fail limit (0.02) at 0 deg, 5 deg, 6.5 deg, 7 deg, 10 deg, so matching Zemax is a band, not a line (zemax-spread). 0 deg: at 314 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.732, Zemax Huygens 0.582 (they differ by 0.150, 7.5 times the fail limit), RayCrafter 0.662: inside the band, 0.070 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 5 deg: at 295 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.726, Zemax Huygens 0.574 (they differ by 0.152, 7.6 times the fail limit), RayCrafter 0.656: inside the band, 0.071 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 6.5 deg: at 262 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.721, Zemax Huygens 0.567 (they differ by 0.153, 7.7 times the fail limit), RayCrafter 0.652: inside the band, 0.069 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.009 outside the band; 7 deg: at 248 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.718, Zemax Huygens 0.564 (they differ by 0.154, 7.7 times the fail limit), RayCrafter 0.650: inside the band, 0.068 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.010 outside the band; 10 deg: at 173 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.664, Zemax Huygens 0.492 (they differ by 0.172, 8.6 times the fail limit), RayCrafter 0.614: inside the band, 0.050 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.053 outside the band0.12710.005 / 0.02Fail
MTF (all wavelengths), other fieldsAt RayCrafter's own frequencies. Against Zemax's Huygens MTF, not its FFT MTF, at 10 deg: the FFT MTF takes the pupil index as linear in the direction cosine, and Zemax's own rays at the image depart from that by 0.092 (more than 0.005; a plane fit of L and M on px, py, over half their range), while the Huygens MTF follows the rays' own directions. It is not exact either: it gives every ray of its pupil grid the same amplitude, so where the density of rays in direction cosine varies across the pupil it weights the pupil by that density, where conservation of energy gives its square root (evaluation #86, https://github.com/raycrafter-optical-design/evaluation/issues/86). The difference from the Huygens MTF there is 0.127; from the FFT MTF, which is not scored there, 0.084. Zemax's own FFT and Huygens MTFs differ from each other by 0.172 at 10 deg (largest of the two azimuths). Zemax's FFT and Huygens MTFs are of one wavelength: the numbers against the band are in the note of the one-wavelength row and in the section on Zemax against itself0.12710.005 / 0.02Fail
Footprint at surface 18 (SMOD objective, back aperture): ray X and Y limitsZemax's numbers are the Footprint Diagram's printed numbers. RayCrafter against Zemax, mm: x min -10.3417 against -10.3417, x max 10.3417 against 10.3417, y min -11.5586 against -11.5586, y max 10.3130 against 10.31303.82e−05 % of the largest radius0.01 / 0.15 % of the largest radiusMatch
Footprint at surface 18 (SMOD objective, back aperture): largest radiusRayCrafter 11.5586 mm, Zemax 11.5586 mm (the Footprint Diagram's printed numbers)3.82e−05 % of the largest radius0.01 / 0.15 % of the largest radiusMatch
Footprint at surface 18 (SMOD objective, back aperture): rim rays, one by oneThe same pupil points round the rim of each field's pupil in both programs; 605 rays paired1.09e−13 mm1e−06 / 0.001 mmMatch
Grid distortion, largestZemax 1.751 %4.9e−07 percentage points0.005 / 0.05 percentage pointsMatch
Distortion, f-tanAt the largest field: Zemax -1.751 %, RayCrafter -1.751 %1.96e−08 percentage points0.005 / 0.05 percentage pointsMatch
Distortion, f-thetaAt the largest field: Zemax -0.7413 %, RayCrafter -0.7413 %9.48e−09 percentage points0.005 / 0.05 percentage pointsMatch
Field curvature, change from the axisAt 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10°, the angles RayCrafter plots1.71e−06 mm0.01 / 0.1 mmMatch
Field curvatureRayCrafter takes the best focus of a whole fan, Zemax that of rays near the chief ray, so they differ with spherical aberration1.71e−06 mm0.01 / 0.1 mmMatch
Not compared

MTF (one wavelength), fields where Zemax's two MTF methods weight the pupil differently: Not scored at 0 deg, 5 deg, 6.5 deg, 7 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.150; ray density varies 2.60 times; RayCrafter differs from the FFT MTF by 0.070 and from the Huygens MTF by 0.080, 0.007 outside the band between them; 5 deg: Zemax's FFT and Huygens MTFs differ by 0.152; ray density varies 2.62 times; RayCrafter differs from the FFT MTF by 0.071 and from the Huygens MTF by 0.081, 0.007 outside the band between them; 6.5 deg: Zemax's FFT and Huygens MTFs differ by 0.153; ray density varies 2.66 times; RayCrafter differs from the FFT MTF by 0.071 and from the Huygens MTF by 0.085, 0.009 outside the band between them; 7 deg: Zemax's FFT and Huygens MTFs differ by 0.154; ray density varies 2.68 times; RayCrafter differs from the FFT MTF by 0.072 and from the Huygens MTF by 0.087, 0.010 outside the band between them. Zemax's own FFT and Huygens MTFs differ by more than the fail limit (0.02) at 0 deg, 5 deg, 6.5 deg, 7 deg, 10 deg, so matching Zemax is a band, not a line (zemax-spread). 0 deg: at 314 cycles/mm, where Zemax's two MTFs differ most (tangential), Zemax FFT 0.732, Zemax Huygens 0.582 (they differ by 0.150, 7.5 times the fail limit), RayCrafter 0.662: inside the band, 0.070 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 5 deg: at 295 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.726, Zemax Huygens 0.574 (they differ by 0.152, 7.6 times the fail limit), RayCrafter 0.656: inside the band, 0.071 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.007 outside the band; 6.5 deg: at 262 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.721, Zemax Huygens 0.567 (they differ by 0.153, 7.7 times the fail limit), RayCrafter 0.652: inside the band, 0.069 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.009 outside the band; 7 deg: at 248 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.718, Zemax Huygens 0.564 (they differ by 0.154, 7.7 times the fail limit), RayCrafter 0.650: inside the band, 0.068 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.010 outside the band; 10 deg: at 173 cycles/mm, where Zemax's two MTFs differ most (sagittal), Zemax FFT 0.664, Zemax Huygens 0.492 (they differ by 0.172, 8.6 times the fail limit), RayCrafter 0.614: inside the band, 0.050 from the nearer Zemax value; over all frequencies RayCrafter is at most 0.053 outside the band

MTF (all wavelengths), fields where Zemax's two MTF methods weight the pupil differently: Not scored at 0 deg, 5 deg, 6.5 deg, 7 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.150; ray density varies 2.60 times; RayCrafter differs from the FFT MTF by 0.070 and from the Huygens MTF by 0.080, 0.007 outside the band between them; 5 deg: Zemax's FFT and Huygens MTFs differ by 0.152; ray density varies 2.62 times; RayCrafter differs from the FFT MTF by 0.071 and from the Huygens MTF by 0.081, 0.007 outside the band between them; 6.5 deg: Zemax's FFT and Huygens MTFs differ by 0.153; ray density varies 2.66 times; RayCrafter differs from the FFT MTF by 0.071 and from the Huygens MTF by 0.085, 0.009 outside the band between them; 7 deg: Zemax's FFT and Huygens MTFs differ by 0.154; ray density varies 2.68 times; RayCrafter differs from the FFT MTF by 0.072 and from the Huygens MTF by 0.087, 0.010 outside the band between them. Zemax's FFT and Huygens MTFs are of one wavelength: the numbers against the band are in the note of the one-wavelength row and in the section on Zemax against itself

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.

FieldAt (cycles/mm)Zemax FFT MTFZemax Huygens MTFZemax's own differenceRayCrafter MTFRayCrafter against the band thereLargest distance outside the band, all frequencies
0 deg3140.7320.5820.1500.662inside the band, 0.070 from the nearer Zemax value0.007
5 deg2950.7260.5740.1520.656inside the band, 0.071 from the nearer Zemax value0.007
6.5 deg2620.7210.5670.1530.652inside the band, 0.069 from the nearer Zemax value0.009
7 deg2480.7180.5640.1540.650inside the band, 0.068 from the nearer Zemax value0.010
10 deg1730.6640.4920.1720.614inside the band, 0.050 from the nearer Zemax value0.053
MTF at 10 deg: Zemax FFT, Zemax Huygens, the band between them, and RayCrafter.
MTF at 10 deg: Zemax FFT, Zemax Huygens, the band between them, and RayCrafter.

Rays

Both programs trace a hexapolar pupil, with the first point of each ring at +x, so the rays that both trace can be paired one by one: RayCrafter's spot diagram (6 rings) with Zemax's ray trace (12 rings).

Spot diagrams about the chief ray: Zemax's rays (red dots) and RayCrafter's (blue dots).
Spot diagrams about the chief ray: Zemax's rays (red dots) and RayCrafter's (blue dots).
The rays both programs trace: worst difference at the image, against field.
The rays both programs trace: worst difference at the image, against field.

RayCrafter's own plots

What RayCrafter's window and report draw, with Zemax's points over them (open markers).

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, tangential and sagittal.
Field curvature, tangential and sagittal.
MTF (one wavelength) at 0°.
MTF (one wavelength) at 0°.
MTF (one wavelength) at 5°.
MTF (one wavelength) at 5°.
MTF (one wavelength) at 6.5°.
MTF (one wavelength) at 6.5°.
MTF (one wavelength) at 7°.
MTF (one wavelength) at 7°.
MTF (one wavelength) at 10°.
MTF (one wavelength) at 10°.
MTF (all wavelengths) at 0°.
MTF (all wavelengths) at 0°.
MTF (all wavelengths) at 5°.
MTF (all wavelengths) at 5°.
MTF (all wavelengths) at 6.5°.
MTF (all wavelengths) at 6.5°.
MTF (all wavelengths) at 7°.
MTF (all wavelengths) at 7°.
MTF (all wavelengths) at 10°.
MTF (all wavelengths) at 10°.

Footprint diagram

Where each field's beam crosses a surface of the design (Zemax's Footprint Diagram, RayCrafter's Bench.footprint_diagram): the rays round the rim of each field's pupil, open red circles for Zemax and filled blue diamonds for RayCrafter, with the surface's clear aperture in black.

Footprint on surface 18 (SMOD objective, back aperture): the rays round the rim of each field's pupil.
Footprint on surface 18 (SMOD objective, back aperture): the rays round the rim of each field's pupil.

The folded layout

RayCrafter's 3D scene from the side, the end and above.
RayCrafter's 3D scene from the side, the end and above.
Zemax: seen from the end (x left, y up).
Zemax: seen from the end (x left, y up).
Zemax: seen from above (y right, z down).
Zemax: seen from above (y right, z down).
Zemax: seen obliquely.
Zemax: seen obliquely.

The numbers behind the rows

For the rows that have no plot of their own. Zemax's values are from our own run; RayCrafter's from its analysis of the project.

First orderZemaxRayCrafter
effective focal length mm-2.73-2.73
f number0.60660.6066
FieldChief ray, Zemax (mm) Chief ray, RayCrafter (mm)Share through, Zemax (%) Share through, RayCrafter (%)RMS spot, Zemax (mm) RMS spot, RayCrafter (mm) Strehl, ZemaxStrehl, RayCrafter Worst ray position difference (mm) Worst ray slope difference
0°001001000.00015310.00015310.9970.9973.554e-154.913e-15
5°-0.2378-0.23781001000.00044060.00044060.9360.93774.463e-157.215e-15
6.5°-0.3087-0.30871001000.00064330.00064330.8350.83924.441e-158.382e-15
7°-0.3323-0.33231001000.00072350.00072350.7840.79075.329e-157.996e-15
10°-0.4729-0.47291001000.0013460.0013460.3080.35555.687e-151.132e-14

Lens data

The radius and thickness in the project file beside the radius Zemax holds, with Zemax's catalogue and index for each glass.

Zemax #TypeRadius, RayCrafter (mm)Radius, Zemax (mm)Thickness (mm)GlassSemi-diameter (mm)
2Standard291.07291.075N-SF6HT SCHOTT, n = 1.78155025.4
3Standard93.1193.1112N-LAK22 SCHOTT, n = 1.64145725.4
4Standard-51.8-51.8125.4
5Standard65.1665.166.18N-BK7 SCHOTT, n = 1.50984025.4
6Standard171.6171.66825.4
7Standard∞∞25.4N-SF1 SCHOTT, n = 1.69897312.7
8Standard∞∞206.512.7
9Standard-2471.073448-2471.0734486.000003N-SF5 SCHOTT, n = 1.65668625.4
10Standard192.834927192.8349276.000001N-SK2 SCHOTT, n = 1.59851425.4
11Standard-233.813021-233.813021225.4
12Standard233.813021233.8130216.000001N-SK2 SCHOTT, n = 1.59851425.4
13Standard-192.834927-192.8349276.000003N-SF5 SCHOTT, n = 1.65668625.4
14Standard2471.0734482471.073448252.1425.4
18Paraxial∞∞12.525

How Zemax was run

By make_zemax_reference.py, the same way for every design, on 2026-12-04 13:34, on fold_SMOD45.zmx exactly as exported (0 failed steps). zmx_export.json ties that file to the project, and the run refuses a file that does not fit it. What is asked for, and why: zemax_analyses.md; every file: Zemax_reference_output.

Reproduce

export UV_PROJECT_ENVIRONMENT=~/uv_venvs/evaluation_mac
uv run python -m evaluation_tools.from_raycrafter.export_zmx --check fold_SMOD45
uv run python -m evaluation_tools.from_raycrafter.compare_zemax fold_SMOD45
uv run python -m evaluation_tools.build_summary

27 quantities compared.