API design

Warning

This page is very much WIP...

Conventions

Right-handedness

All coordinate systems are or must be defined right-handed! All normal vectors are or must be defined right-handed! All rotations are or must be performed in a counter-clockwise manner for a positive rotation angle $\theta > 0$ and vice-versa! For a definition of rotation matrix order, refer to this article.

Warning

Failure to comply with this convention can lead to spurious effects and silent bugs when using the kinematic API of this package!

Intersect - Interact - Repeat - Loop (IIRP)

Tracing

Retracing

CPU and GPU

Info

GPU processing (tracing) of optical systems is not supported at the moment.

Geometry representation

Meshes

Signed Distance Functions (SDFs)

For an introduction into SDFs the website of Inigo Quilez is referred to. The following shapes have been implemented:

julia> BeamletOptics.list_subtypes(BeamletOptics.AbstractSDF);└── BeamletOptics.AbstractSDF
    ├── BeamletOptics.AbstractLensSDF
    │   ├── BeamletOptics.AbstractAsphericalSurfaceSDF
    │   │   ├── BeamletOptics.ConcaveAsphericalSurfaceSDF
    │   │   └── BeamletOptics.ConvexAsphericalSurfaceSDF
    │   ├── BeamletOptics.AbstractCylindricalSurfaceSDF
    │   │   └── BeamletOptics.AbstractAcylindricalSurfaceSDF
    │   │       ├── BeamletOptics.AconcaveCylinderSDF
    │   │       └── BeamletOptics.AconvexCylinderSDF
    │   ├── BeamletOptics.AbstractSphericalSurfaceSDF
    │   │   ├── BeamletOptics.ConcaveSphericalSurfaceSDF
    │   │   └── BeamletOptics.ConvexSphericalSurfaceSDF
    │   ├── BeamletOptics.ConcaveCylinderSDF
    │   ├── BeamletOptics.ConvexCylinderSDF
    │   ├── BeamletOptics.MeniscusLensSDF
    │   ├── BeamletOptics.PlanoSurfaceSDF
    │   └── BeamletOptics.SphereSDF
    ├── BeamletOptics.BoxSDF
    ├── BeamletOptics.CutSphereSDF
    ├── BeamletOptics.CylinderSDF
    ├── BeamletOptics.RightAnglePrismSDF
    ├── BeamletOptics.RingSDF
    └── BeamletOptics.UnionSDF

At least 22 types have been found.