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
- Every lens has a rim, and the rim blocks rays. Whatever you do in RayCrafter (pick a catalogue lens, drag it, import a file), a ray that reaches a lens outside its clear diameter is lost. The side view draws each lens at that size, so what you see is what is traced.
- Zemax does not work this way. It blocks rays only at surfaces that have an aperture (circular, floating or
rectangular). A surface's semi-diameter (
DIAM) only sets the size it is drawn; rays outside it still pass. A surface with no aperture blocks nothing, however far from the axis a ray is. - The consequence. Take a beam wider than a lens whose Zemax surfaces have no aperture. Zemax passes the whole beam. RayCrafter clips it at the lens rim, so spots, MTF and throughput can differ. The reverse does not happen: a lens with an aperture is clipped the same way in both.
- Why. Real lenses have edges, and clipping by the real edge is usually what a bench builder needs to know. A lens's drawn size is often its real size (for example the back aperture of a microscope objective), so silently widening it to match Zemax would hide real clipping.
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
- Lenses are grouped from surfaces. A lens is a run of surfaces with glass between them, ending at the first surface followed by air. Each glass lens is looked up in the lens catalogue, so a vendor lens comes back with its part number and catalogue data. A lens that is not found keeps its prescription and is named “Imported lens N”. A paraxial surface becomes a paraxial lens.
- Rectangular apertures (such as a beamsplitter cube) are replaced by the round aperture that fits inside them. A note says so.
- Apertures on surfaces in air (not part of a lens) are not imported yet; a note says so. RayCrafter has its own apertures, which you can add by hand where the file had them.
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.