RayCrafter (dev) vs Zemax

100 mm asphere, object at infinity: RayCrafter (dev) against Zemax

Thorlabs AL50100-A asphere with a 40 mm collimated beam at 555 nm and four fields to 2 degrees.

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

The design

Thorlabs AL50100-A asphere with a 40 mm collimated beam at 555 nm and four fields to 2 degrees.

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

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°, 0.5°, 1°, 2°).

18matching
4partial
0failing

Not matching: partial and fail rows.

QuantityLargest difference from ZemaxMatch / partial withinResult
RMS spot against focus, every fieldWhere the two ranges overlap0.1031 % of the largest0.1 / 2 % of the largestPartial
RMS wavefront against fieldPiston and tilt removed; at the largest field, Zemax 1.282 and RayCrafter 1.279 waves0.00282 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failPartial
MTF (one wavelength), every fieldAt RayCrafter's own frequencies.0.014690.005 / 0.02Partial
MTF (all wavelengths), every fieldAt RayCrafter's own frequencies.0.014690.005 / 0.02Partial
All 22 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-BK701e−06 / 0.0001Match
Rays at the image, ray by ray: positionThe rays that both programs trace and get through: 331 at 0, 331 at 0.5, 331 at 1, 331 at 22.89e−08 mm1e−06 / 0.001 mmMatch
Rays at the image, ray by ray: slopedx/dz and dy/dz1.69e−101e−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 % (331 of 331 rays through); at 0.5, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through); at 1, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through); at 2, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through)0 % points0.5 / 2 % pointsMatch
Chief ray at the image, every field1.33e−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)2.22e−14 %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 sagittal6.47e−08 mm1e−06 / 0.001 mmMatch
RMS spot against focus, every fieldWhere the two ranges overlap0.1031 % 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 1.282 and RayCrafter 1.279 waves0.00282 waves0.001 / 0.01 waves, or 1 % of Zemax's if larger, to failPartial
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.0007760.005 / 0.02Match
MTF (one wavelength), every fieldAt RayCrafter's own frequencies.0.014690.005 / 0.02Partial
MTF (all wavelengths), every fieldAt RayCrafter's own frequencies.0.014690.005 / 0.02Partial
Grid distortion, largestZemax 0.002308 %1.35e−07 percentage points0.005 / 0.05 percentage pointsMatch
Distortion, f-tanAt the largest field: Zemax -0.002308 %, RayCrafter -0.002308 %2.69e−11 percentage points0.005 / 0.05 percentage pointsMatch
Distortion, f-thetaAt the largest field: Zemax 0.03833 %, RayCrafter 0.03833 %3.8e−10 percentage points0.005 / 0.05 percentage pointsMatch
Field curvature, change from the axisAt 0, 1, 2°, the angles RayCrafter plots0.000321 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 aberration0.000321 mm0.01 / 0.1 mmMatch

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 (10 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 0.5°.
MTF (one wavelength) at 0.5°.
MTF (one wavelength) at 1°.
MTF (one wavelength) at 1°.
MTF (one wavelength) at 2°.
MTF (one wavelength) at 2°.
MTF (all wavelengths) at 0°.
MTF (all wavelengths) at 0°.
MTF (all wavelengths) at 0.5°.
MTF (all wavelengths) at 0.5°.
MTF (all wavelengths) at 1°.
MTF (all wavelengths) at 1°.
MTF (all wavelengths) at 2°.
MTF (all wavelengths) at 2°.

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 mm98.6498.64
f number2.4662.466
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.023110.023110.0010.0013041.87e-082.168e-16
0.5°0.85940.85941001000.022090.022090.0040.0043072.126e-084.17e-11
1°1.7191.7191001000.019430.019430.0090.0089862.382e-088.375e-11
2°3.4393.4391001000.018810.018810.0150.014222.892e-081.691e-10

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)
1Even Asphere (stop)51.1251.1210N-BK7 SCHOTT, n = 1.51827425
2Standard∞∞91.88594525

How Zemax was run

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

22 quantities compared.