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

RayCrafter dev 5ecb2efd Zemax 24.1.3 λ 0.5876 µm Zemax run 2026-12-03 21:18

The design

Thorlabs ACN127-020-A (12.7 mm) under a collimated 20 mm beam at 587.6 nm.

RayCrafter's own ray diagram.
RayCrafter's own ray diagram.

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

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

10matching
0partial
0failing

Every row matches Zemax.

All 10 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
Refractive index of each glassN-BAF10, N-SF6HT2.22e−161e−06 / 0.0001Match
Focal length3.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 outside1.78e−15 mm1e−06 / 0.001 mmMatch
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 % points0.5 / 2 % pointsMatch
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 pattern0.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 pattern0.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 pattern0.3682 %1 / 2 %Match
Not compared

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.

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 entrance pupil

The entrance pupil: the rays Zemax lets through and those it stops, and the edge of the light RayCrafter lets through.
The entrance pupil: the rays Zemax lets through and those it stops, and the edge of the light RayCrafter lets through.

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
effective focal length mm-20.09-20.09
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 (stop)-13.53-13.531.5N-BAF10 SCHOTT, n = 1.6700276.35
2Standard14.2514.253N-SF6HT SCHOTT, n = 1.8051746.35
3Standard87.987.9205.56.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.