RayCrafter (dev) vs Zemax
Stopped-down relay: Collimate: RayCrafter (dev) against Zemax
A stopped-down relay on which RayCrafter's Collimate once set the gap to 0 mm. It now finds 200 mm, and Zemax's rays leave that file collimated. The radius of the light agrees to within 0.5 %; it was 2.5 % 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 in front of two ideal 100 mm lenses, saved at the 200 mm gap RayCrafter's Collimate found. It once set that gap to 0 mm (raycrafter #193).

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 8 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 |
| Angular magnification (size)Zemax's from its paraxial pupils, RayCrafter's from real rays; RayCrafter's sign says whether the image is inverted | 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.5, RayCrafter 0.49775. Zemax: 331 of 30301 rays get through. RayCrafter: 331 rays of a pattern fitted to the opening | 0.4495 % | 1 / 2 % | Match |
| Divergence at the gap RayCrafter's Collimate foundZemax 5.408471e-13, RayCrafter 3.538276e-13. The exported file is saved at that gap, so Zemax's rays must leave it collimated | 1.87e−13 µrad | 1 / 50 µrad | Match |
| Collimate, run again: the gapZemax 200, RayCrafter 200. Against the gap in the file that Zemax traced | 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. With Afocal Image Space ticked Zemax's trace ends on the exit pupil, so its rays are carried on to the image plane.

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 |
|---|---|---|
| angular magnification | 1 | -1 |
| 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) | ∞ | ∞ | 200 | 25.4 | |
| 3 | Paraxial | ∞ | ∞ | 1 | 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_relay.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_relay uv run python -m evaluation_tools.from_raycrafter.compare_zemax stopped_down_beam_relay uv run python -m evaluation_tools.build_summary
8 quantities compared.