RayCrafter (dev) vs Zemax
Stopped-down beam: autofocus: RayCrafter (dev) against Zemax
A beam cut to a tenth of its width, once sent by RayCrafter's autofocus to 1 mm behind the lens. Run again, autofocus now agrees with Zemax (150 mm). The size of the light agrees to within 0.8 %; it was 2.5 to 3 % small until RayCrafter searched the edge of the opening more finely (raycrafter #197).
The design
A 10 mm beam at 555 nm cut to 1.001 mm by an aperture 5 mm in front of an ideal 50 mm lens, with the image plane 10 mm behind the focus. RayCrafter's autofocus once sent it 1 mm behind the lens (raycrafter #129).

RayCrafter against Zemax
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°).
Every row matches Zemax.
All 9 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Zemax reads the aperture, fields, wavelength and afocal setting that were meant | 0 warnings | 0 / 0 warnings | Match |
| Surfaces: thicknesses, gaps and semi-diametersThe project file against the lens data Zemax holds | 0 mm | 1e−09 / 1e−06 mm | Match |
| Surfaces: curvatures and conicsCurvature in 1/mm | 0 | 1e−12 / 1e−09 | Match |
| Focal length | 0 % | 0.0001 / 0.1 % | Match |
| Share of the pupil's rays that get through the aperturesRayCrafter's vignetting analysis 1.00 %; Zemax's rays allow 1.00 to 1.21 % | 0.0025 % points | 0.5 / 2 % points | Match |
| Radius of the light at the imageZemax 0.1, RayCrafter 0.099551. Zemax: 331 of 30301 rays get through. RayCrafter: 331 rays of a pattern fitted to the opening | 0.4495 % | 1 / 2 % | Match |
| RMS spot radiusZemax 0.070945, RayCrafter 0.070393. Zemax: 331 of 30301 rays get through. RayCrafter: 331 rays of a pattern fitted to the opening | 0.7786 % | 1 / 2 % | Match |
| Divergence behind the lensZemax 7094.3, RayCrafter 7039.1. Zemax: 331 of 30301 rays get through. RayCrafter: 331 rays of a pattern fitted to the opening | 0.7785 % | 1 / 2 % | Match |
| Autofocus: where the image plane goesZemax 150, RayCrafter 150. Zemax: where the RMS spot of its rays is smallest | 0 mm | 0.0001 / 0.001 mm | Match |
Rays
An aperture stops all but a small part of the beam. Zemax traces a dense hexapolar pupil, of which only the middle gets through; RayCrafter fits its pattern to the opening. The rays are therefore not paired.

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 order | Zemax | RayCrafter |
|---|---|---|
| effective focal length mm | 50 | 50 |
| Field | Chief ray, Zemax (mm) | Chief ray, RayCrafter (mm) | Share through, Zemax (%) | Share through, RayCrafter (%) | RMS spot, Zemax (mm) | RMS spot, RayCrafter (mm) | Strehl, Zemax | Strehl, RayCrafter | Worst ray position difference (mm) | Worst ray slope difference |
|---|---|---|---|---|---|---|---|---|---|---|
| 0° | none | none | none | none | none | none | none | none | none | none |
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 # | Type | Radius, RayCrafter (mm) | Radius, Zemax (mm) | Thickness (mm) | Glass | Semi-diameter (mm) |
|---|---|---|---|---|---|---|
| 1 | Standard | ∞ | ∞ | 5 | 0.5 | |
| 2 | Paraxial (stop) | ∞ | ∞ | 60 | 25.4 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-03, on stopped_down_beam_focus.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 stopped_down_beam_focus uv run python -m evaluation_tools.from_raycrafter.compare_zemax stopped_down_beam_focus uv run python -m evaluation_tools.build_summary
9 quantities compared.