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

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

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

8matching
0partial
0failing

Every row matches Zemax.

All 8 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
Angular magnification (size)Zemax's from its paraxial pupils, RayCrafter's from real rays; RayCrafter's sign says whether the image is inverted0 %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 % points0.5 / 2 % pointsMatch
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 opening0.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 collimated1.87e−13 µrad1 / 50 µradMatch
Collimate, run again: the gapZemax 200, RayCrafter 200. Against the gap in the file that Zemax traced0 mm0.0001 / 0.001 mmMatch

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.

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 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
angular magnification1-1
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°nonenonenonenonenonenonenonenonenonenone

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∞∞50.5
2Paraxial (stop)∞∞20025.4
3Paraxial∞∞125.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.