RayCrafter (dev) vs Zemax
AC254-050-A as an objective at infinity: RayCrafter (dev) against Zemax
A Thorlabs AC254-050-A turned to work as an objective, exported by RayCrafter and traced by Zemax. Since RayCrafter d5d3377 the export writes ray aiming (raycrafter #204), so Zemax fills the stop as RayCrafter does: every ray gets through in both programs, where Zemax stopped 18 % of its rays before. Ray by ray the two now agree to 4.06e-07 mm in position and 6.65e-10 in slope at every field (Match). RayCrafter aims its outermost rays 1e-7 of the stop's radius inside the rim so that none is blocked there (raycrafter #239; it was 2e-5, 0.08 µm at this stop's 4 mm radius, which was the whole of the earlier Partial).
The design
A Thorlabs AC254-050-A turned to work as an objective: the object on its front focal plane (555 nm), an 8 mm stop 0.5 mm behind it that the fields fill, object heights 0, 1.5 and 3 mm. Every point leaves collimated.

What is tested
Distortion of a finite object imaged at infinity, measured on the leaving angles (Afocal Image Space, #166), on a real lens. RayCrafter's value agrees, by reversibility, with its beam distortion of the lens turned round.
Issue: raycrafter #166, raycrafter #204.
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 mm, 1.5 mm, 3 mm).
Every row matches Zemax.
All 13 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 |
| Refractive index of each glassN-BAF10, SF10 | 0 | 1e−06 / 0.0001 | Match |
| Rays at the image, ray by ray: positionThe rays that both programs trace and get through: 331 at 0, 331 at 1.5, 331 at 3 | 4.06e−07 mm | 1e−06 / 0.001 mm | Match |
| Rays at the image, ray by ray: slopedx/dz and dy/dz | 6.65e−10 | 1e−08 / 1e−05 | Match |
| 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 1.5, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through); at 3, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through) | 0 % points | 0.5 / 2 % points | Match |
| Chief ray at the image, every field | 3.48e−08 mm | 1e−06 / 0.001 mm | Match |
| Focal length | 3.33e−14 % | 0.0001 / 0.1 % | Match |
| Divergence of the leaving light, every fieldRayCrafter: RMS angle to the mean direction. Zemax: its RMS spot radius, which is an angle when the image space is afocal | 0.07626 % | 0.1 / 2 % | Match |
| 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.001494 | 0.005 / 0.02 | Match |
| Grid distortion, largestZemax 0.0681 %, on the leaving angles | 1.68e−05 percentage points | 0.005 / 0.05 percentage points | Match |
| Distortion against object height | 3.22e−09 percentage points | 0.005 / 0.05 percentage points | Match |
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). With Afocal Image Space ticked Zemax's trace ends on the exit pupil, so its rays are carried on to the image plane.


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

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.14 | 50.14 |
| 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 mm | 0 | 0 | 100 | 100 | none | none | 0.062 | 0.06343 | 3.805e-07 | 4.307e-10 |
| 1.5 mm | -1.481 | -1.481 | 100 | 100 | none | none | 0.047 | 0.04839 | 4.059e-07 | 5.405e-10 |
| 3 mm | -2.964 | -2.964 | 100 | 100 | none | none | 0.039 | 0.04049 | 3.967e-07 | 6.647e-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 # | Type | Radius, RayCrafter (mm) | Radius, Zemax (mm) | Thickness (mm) | Glass | Semi-diameter (mm) |
|---|---|---|---|---|---|---|
| 1 | Standard | 33.34 | 33.34 | 9 | N-BAF10 SCHOTT, n = 1.672617 | 12.7 |
| 2 | Standard | -22.28 | -22.28 | 2.5 | SF10 SCHOTT, n = 1.732869 | 12.7 |
| 3 | Standard | -291.07 | -291.07 | 0.5 | 12.7 | |
| 4 | Standard (stop) | ∞ | ∞ | 49.5 | 4 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-03, on objective_at_infinity_AC254-050-A.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 objective_at_infinity_AC254-050-A uv run python -m evaluation_tools.from_raycrafter.compare_zemax objective_at_infinity_AC254-050-A uv run python -m evaluation_tools.build_summary
13 quantities compared.