What is RayCrafter?
RayCrafter is simple software for tracing rays through optical systems built from off-the-shelf parts. You pick lenses from a catalogue, drop them on an optical axis, drag them around, and watch the result update as you move them.

Very early stages of development. RayCrafter is pre-alpha. It has bugs, features are missing, and anything may change, including file formats. Please check results against other tools before you rely on them. See known problems. Detailed validation against Zemax is in the pipeline but is not yet started. Preliminary results, however, indicate good alignment with Zemax on many metrics.
It is common for custom microscopes to be designed and built around off-the-shelf components and lenses. The optical paths of these systems need to be ray-traced and analysed, but no new lenses need to be designed or optimised. RayCrafter addresses this need, as it works on the lens level rather than the surface level, as is common in software such as Zemax. Furthermore, software such as Zemax is complicated and aimed at optical engineers. Many builders of DIY microscopes are not optical engineers, and so would benefit from software that has a smaller and more tailored subset of features. Finally, RayCrafter is also aimed at being a teaching tool for students new to optical design. Students will be able to play with arrangements of ideal lenses before replacing them with real lenses to see the consequences.
RayCrafter aims to fill this gap. It allows designers to freely place lenses on an optical path and immediately see results on spot diagrams, MTF plots, etc. Lenses can be grouped into assemblies and the distances between them locked, and a chosen distance can be optimised to collimate or focus the light. A web report summarises the system, with explanatory text to help the user interpret the results. For students, teaching overlays draw the chief and marginal rays, pupils and focal points on the design, and guided tutorials build designs step by step in the program.
Current features
RayCrafter currently has:
- Built around real, off-the-shelf lenses. The full Thorlabs catalogue (spherical lenses, achromats, air-spaced doublets, triplets and matched pairs) is built in, plus ideal (paraxial) lenses with a focal length you choose.
- Not surface based. You do not enter radii, thicknesses and glasses one surface at a time. You place whole lenses.
- Not lens design. RayCrafter does not optimise or invent lenses. It helps you work out how a set of lenses you could buy will behave together: spacing, focus, aberrations, image quality.
- Easy to use. Drag lenses and watch the plots update live. Replace one lens with another in place. Undo and redo.
- Exact spacing. Type the gaps between lenses, lock the ones that should not change, or have a gap found for you. Elements snap to focal points.
- Assemblies. Group lenses (a Plossl pair, say), move and flip them as one, and save them as parts to use again.
- Light. Any number of beams, each with its own width, angle, vergence, offset and wavelength, or points of a finite object.
- Apertures and detectors. Variable apertures, an aperture stop that the light can be made to fill, and a detector that reports how much light lands on it.
- Analysis. Spot diagram, through-focus, MTF, ray fan, field curvature and distortion; point spread function and Strehl ratio; field of view, vignetting and relative illumination; colour; and a 3D view.
- Lasers and scanning. Readouts for collimated output, the beams on a back aperture, and transmission and pulse dispersion.
- Image simulation. See a picture as your design images it.
- Compare designs. Keep named variants in one project and view them side by side.
- Teaching. Teaching overlays, example designs and optics tutorials.
- Files and reports. Save your work as a project file, import and export Zemax
.zmxfiles, export STEP files for CAD, and open a web report that updates as you work. - Scriptable. Use it from Python, or let an AI agent build and analyse designs while you watch.
- Cross platform. Runs on Windows, macOS and Linux.
Built on Optiland
The ray tracing itself is done by Optiland, an open-source Python optical design library. RayCrafter is a simple front end for it, aimed at people who want to build and understand a lens system rather than design one from scratch.
Where next
- Install and start RayCrafter, with step-by-step instructions for Windows and Mac.
- A tour of what is on the screen.
- Analysis plots.
- The optics tutorials.
- Files and reports.
- The Python API and AI agents.
- Known problems.