RayCrafter (dev) vs Zemax

Cut-cone object point: MTF: RayCrafter (dev) against Zemax

An object point whose cone of NA 0.04 is cut by the rim of a 25.4 mm lens to NA 0.032. The MTF now ends at the cutoff of the light that gets through, as Zemax's does (raycrafter #142, #174). The rest matches too: with Zemax's 96 rings of rays and RayCrafter launched at the same pupil points (raycrafter #231), the RMS spot radius of the fields with rays stopped agrees to 1e-11 %; and read on the pixel grid of Zemax's Huygens PSF, RayCrafter's Strehl ratio is 0.1336 against Zemax's 0.133 (the wavefront of the rays that get through matches). Only the MTF is Partial.

RayCrafter dev 5ecb2efd Zemax 24.1.3 λ 0.555 µm Zemax run 2026-12-03 21:19

The design

An object point on axis, and one at 1 mm, each with an object-space NA of 0.04 at 555 nm, imaged by a Thorlabs AC254-100-A 400 mm away. The lens rim passes NA 0.0317, 79 % of the cone's diameter. RayCrafter once gave the MTF the cutoff of the whole cone (raycrafter #142, #174).

RayCrafter's own ray diagram.
RayCrafter's own ray diagram.

What is tested

The MTF of an object point whose cone a lens rim cuts: it must end at the cutoff of the light that gets through, not of the whole cone.

Issue: raycrafter #142, raycrafter #174.

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 mm, 1 mm).

15matching
2partial
0failing

Not matching: partial and fail rows.

QuantityLargest difference from ZemaxMatch / partial withinResult
MTF (one wavelength), every fieldAt RayCrafter's own frequencies.0.006770.005 / 0.02Partial
MTF (all wavelengths), every fieldAt RayCrafter's own frequencies.0.006770.005 / 0.02Partial
All 17 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, SF501e−06 / 0.0001Match
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 62.5 %, Zemax 61.0 to 62.7 % (17101 of 27937 rays through); at 1, RayCrafter 62.5 %, Zemax 61.0 to 62.7 % (17101 of 27937 rays through)0 % points0.5 / 2 % pointsMatch
Chief ray at the image, every field6.11e−16 mm1e−06 / 0.001 mmMatch
Focal length1.11e−14 %0.0001 / 0.1 %Match
RMS spot radius, fields with rays stopped, against Zemax's own raysZemax's RMS operand counts the stopped rays too, so its rays that get through are used, and RayCrafter's rays are launched at the same pupil points. field 0: Zemax's rays 13.9, RayCrafter 13.9 (launched at Zemax's pupil points; 0 points through in one program only), RayCrafter's spot diagram 14.03, Zemax's operand 34.28, RayCrafter's own rays summed finely 14.17 um; field 1: Zemax's rays 13.99, RayCrafter 13.99 (launched at Zemax's pupil points; 0 points through in one program only), RayCrafter's spot diagram 14.12, Zemax's operand 34.46, RayCrafter's own rays summed finely 14.26 um1.36e−11 %1 / 2 %Match
Ray fans, tangential and sagittal4.15e−14 mm1e−06 / 0.001 mmMatch
RMS wavefront, every fieldAt fields 0, 1, where Zemax's apertures stop rays, Zemax's Wavefront Map (piston and tilt removed) of the rays that get through: its RMS operand counts the stopped rays too (evaluation #72). Both numbers are fitted the same way: the evaluation takes a least-squares plane (piston and tilt) out of Zemax's Wavefront Map and out of RayCrafter's own wavefront map over the pupil, every point that got through alike (raycrafter #243, Rob's decision of 2026-12-04). RayCrafter's reported RMS wavefront and Zemax's RMS operand, which take the tilt out in direction cosines on a focused image, are a different convention (on the focused designs of #243 a plane in pupil coordinates was 1.5 to 8 % from Zemax's operand), so they are not what is compared here. RayCrafter's map is traced with 513 rays across the part of the pupil that gets light, where its RMS has converged (its window's 65 were 1.6 % low on US005899585 at 15.12 mm). Zemax's map is 64 x 64, and on a field whose rays are stopped where the wavefront is steep its RMS depends on where its grid falls: on US005899585 at 15.12 and 21.6 mm a 64 x 64 grid moved by under a step changes the RMS by 0.9 % (one standard deviation), so differences of that size can be Zemax's sampling. RayCrafter's own reported RMS wavefront, for information (waves): 0: 0.3325 (fitted 0.3326), 1: 0.3322 (fitted 0.3322)6.28e−05 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 decimals.0.000880.005 / 0.02Match
MTF (one wavelength), every fieldAt RayCrafter's own frequencies.0.006770.005 / 0.02Partial
MTF (one wavelength), cutoff frequency, every fieldOf the fields where Zemax's table reaches beyond the cutoff. Cycles/mm, RayCrafter then Zemax: 346 and 348; 346 and 3480.4734 %2 / 5 %Match
MTF (all wavelengths), every fieldAt RayCrafter's own frequencies.0.006770.005 / 0.02Partial
MTF (all wavelengths), cutoff frequency, every fieldOf the fields where Zemax's table reaches beyond the cutoff. Cycles/mm, RayCrafter then Zemax: 346 and 348; 346 and 3480.4734 %2 / 5 %Match
Grid distortion, largestZemax 1.8e-05 %4.58e−07 percentage points0.005 / 0.05 percentage pointsMatch
Distortion against object height4.1e−13 percentage points0.005 / 0.05 percentage pointsMatch
Not compared

Rays at the image, ray by ray: Not compared at these fields: an aperture stops part of the light, and the two pupil patterns do not have the same points among what is left (or RayCrafter has fitted its pattern to the opening). The share of light through is scored below. at 0, Zemax 17101 of 27937 rays through, RayCrafter 17101 of 27937; at 1, Zemax 17101 of 27937 rays through, RayCrafter 17101 of 27937

RMS spot against focus: Some rays are stopped, and Zemax's RMS operands count them all the same, so there is no number of Zemax's to compare with

Rays

At every field an aperture or rim stops part of the beam. Zemax's dense hexapolar pupil and RayCrafter's pattern do not have the same points among those that get through, and RayCrafter has fitted its pattern to the opening, so the rays are not paired. The share of the pupil that gets through is scored instead.

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).

RayCrafter's own plots

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

Some rays are stopped. Zemax's RMS spot and RMS wavefront against field count them all the same, so those two plots do not compare like with like where they are.

The pupil of each field: the rays Zemax lets through and those it stops.
The pupil of each field: the rays Zemax lets through and those it stops.
Distortion against object height.
Distortion against object height.
MTF (one wavelength) at 0 mm.
MTF (one wavelength) at 0 mm.
MTF (one wavelength) at 1 mm.
MTF (one wavelength) at 1 mm.
MTF (all wavelengths) at 0 mm.
MTF (all wavelengths) at 0 mm.
MTF (all wavelengths) at 1 mm.
MTF (all wavelengths) at 1 mm.

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 mm100100
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 mm0061.8562.50.034280.014030.1740.1749nonenone
1 mm-0.3307-0.330761.8562.50.034460.014120.1330.1336nonenone

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)
1Standard (stop)62.7562.754N-BK7 SCHOTT, n = 1.51827412.7
2Standard-45.71-45.712.5SF5 SCHOTT, n = 1.67647212.7
3Standard-128.23-128.23129.78742512.7

How Zemax was run

By make_zemax_reference.py, the same way for every design, on 2026-12-03 21:19, on cut_cone_object_point.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 cut_cone_object_point
uv run python -m evaluation_tools.from_raycrafter.compare_zemax cut_cone_object_point
uv run python -m evaluation_tools.build_summary

17 quantities compared.