RayCrafterdocumentation

Simple ray tracing with off-the-shelf optics. Very early software: expect rough edges.

How lenses work, compared with Zemax

RayCrafter is built around physical lenses with a size, where Zemax is built around a list of surfaces with optional apertures. This is a design choice that runs through the whole program, not just file loading. It makes sense for the kind of design RayCrafter is for (off-the-shelf lenses on a bench), and we may change it later. This page explains it, because it is the main reason a design can give different results here and in Zemax.

The design choice

Where a lens's size comes from

A catalogue lens has its catalogue size. For a lens imported from a file, the size is, in order: the aperture in the file, the catalogue size if the lens is recognised, or the drawn semi-diameter (DIAM). RayCrafter does not widen a lens to match Zemax; after importing, it adds a note for each lens that now blocks rays Zemax lets through.

What this means when importing a Zemax file

Fields

Zemax gives every field the same entrance pupil and object, and pairs every field angle with every wavelength. RayCrafter makes one field for each field angle at the primary wavelength, and one on-axis field for each other wavelength. With several angles, the fields are coloured by angle, as in Zemax. Field x coordinates are dropped, because RayCrafter tilts beams in y only. A finite object is imported as diverging beams.

When the stop is in air in front of the first lens (a scan mirror, for example), the source plane is put at the stop, so each beam’s chief ray passes through its centre. Otherwise the source plane is at the first lens and the beams are centred on it. Either way the gap from the source plane is locked, so moving the first lens carries the beams with it. If the stop is behind the first lens, angled beams are not aimed through it, and a note says so.

The import does not mark any element as the aperture stop. To aim the fields through a stop inside the system, right-click a lens (or an aperture you add) and tick Aperture stop, then tick Fields fill the stop.

Not supported yet

Aspheres, conics, mirrors (and so folded paths), tilts and decentres are not supported: a file that contains them does not import. Nor does a file with a glass that has no catalogue name (a model glass).

Keeping and exporting

An imported design is saved as a RayCrafter project, which keeps the original ZMX file. Exporting back to Zemax is lossy.