Cherry is a library for sequential optical system design.
The core structure of sequential optical design is the SequentialModel which is a set of submodels containing surfaces and gaps between surfaces. Each SequentialSubModel corresponds to a unique set of system parameters, i.e. a wavelength and a transverse axis. A submodel provides an interface to iterate over the surfaces and gaps in the system.
Inputs to the system are provided by specs, of which there are several types:
- SurfaceSpec - Describes a surface in the system for which surface sag or paraxial ray trace matrices can be calculated.
- GapSpec - Describes a gap between surfaces in the system. Refractive index data is located here.
- ApertureSpec - Describes the aperture of the system. This may differ from any pupils that can be derived directly from the surfaces and gaps.
- FieldSpec - Describes the field points of the system.
- RefractiveIndexSpec - Describes the refractive index of a gap.
- Wavelength - Describes a single wavelength to model.
The outputs of the system are provided by views, such as:
- ParaxialView - A paraxial view of the system. Contains information such as focal length, principal planes, etc.
- RayTrace3DView - A 3D ray trace view of the system.
- CutawayView - A cutaway view of the system. Used primarily for drawing the system.
- ComponentsView - A view of the components of the system. Used for grouping surfaces into lenses.
Quick Start
use ;
// Create a convexplano lens with an object at infinity.
let air = n!;
let nbk7 = n!;
// Define a set of gaps between surfaces.
let gaps = vec!;
// Define a set of surfaces in the system.
let surfaces = vec!;
// Define a set of wavelengths to model.
let wavelengths: = vec!;
// Create a sequential model from the gaps, surfaces, and wavelengths.
let sequential_model = new.unwrap;
// Define a user-defined system aperture.
let aperture_spec = EntrancePupil ;
// Analyze the system at two different field points, sampling the pupil
// with a square grid with a spacing of 0.1 in normalized pupil coordinates.
let field_specs = vec!;
// Compute the paraxial view of the system.
let paraxial_view = new.unwrap;
// Compute the effective focal length of the lens for each submodel.
for in sequential_model.submodels
// Compute a 3D ray trace of the system.
let rays = ray_trace_3d_view.unwrap;