RayCrafter (dev) vs Zemax
Negative lens under a wide beam: RayCrafter (dev) against Zemax
A beam wider than a negative lens passes: RayCrafter clips it at the same diameter as Zemax, and now every row matches. The light at the image, its RMS spot radius and its divergence are within 0.5 % of Zemax's (raycrafter #4).
The design
Thorlabs ACN127-020-A (12.7 mm) under a collimated 20 mm beam at 587.6 nm.

What is tested
RayCrafter blocks rays outside the clear aperture at every surface, so a negative lens clips more at its back surface than at its front. Which rays does Zemax let through, and what f-number does it report?
Issue: raycrafter #4, raycrafter #5.
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 10 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, N-SF6HT | 2.22e−16 | 1e−06 / 0.0001 | Match |
| Focal length | 3.33e−14 % | 0.0001 / 0.1 % | Match |
| Diameter of the entrance beam that gets throughZemax: between 10.8 and 11 mm (its rings of rays); RayCrafter 10.8 mm. The difference is how far RayCrafter's lies outside | 1.78e−15 mm | 1e−06 / 0.001 mm | Match |
| Share of the pupil's rays that get through the aperturesRayCrafter's vignetting analysis 29.50 %; Zemax's rays allow 29.16 to 30.25 % | 0 % points | 0.5 / 2 % points | Match |
| Radius of the light at the imageZemax 64.283, RayCrafter 64.542. Zemax: 8911 of 30301 rays get through. RayCrafter: 8911 rays of its spot pattern | 0.4037 % | 1 / 2 % | Match |
| RMS spot radiusZemax 44.816, RayCrafter 44.989. Zemax: 8911 of 30301 rays get through. RayCrafter: 8911 rays of its spot pattern | 0.3867 % | 1 / 2 % | Match |
| Divergence behind the lensZemax 1.9197e+05, RayCrafter 1.9267e+05. Zemax: 8911 of 30301 rays get through. RayCrafter: 8911 rays of its spot pattern | 0.3682 % | 1 / 2 % | Match |
f-number (recorded, not scored: raycrafter #5): RayCrafter f/1.860, of the light that gets through. Zemax: image space f/1.004, working f/1.004, both of the whole 20 mm beam: it ignores apertures. With Float By Stop Size: image space f/1.582, working f/1.576
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 when few of its rays get through. The rays are therefore not paired.

The entrance pupil

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 | -20.09 | -20.09 |
| 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 (stop) | -13.53 | -13.53 | 1.5 | N-BAF10 SCHOTT, n = 1.670027 | 6.35 |
| 2 | Standard | 14.25 | 14.25 | 3 | N-SF6HT SCHOTT, n = 1.805174 | 6.35 |
| 3 | Standard | 87.9 | 87.9 | 205.5 | 6.35 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-03 21:18, on clipped_negative_lens.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 clipped_negative_lens uv run python -m evaluation_tools.from_raycrafter.compare_zemax clipped_negative_lens uv run python -m evaluation_tools.build_summary
10 quantities compared.