2D Visualization in Non-default Axes

[1]:
import optiland.backend as be
from optiland.optic import Optic
[2]:
toroidal_lens = Optic()

# add surfaces
toroidal_lens.surfaces.add(index=0, radius=be.inf, thickness=be.inf)
toroidal_lens.surfaces.add(
    index=1,
    thickness=7,
    radius_x=30,
    radius_y=50,
    is_stop=True,
    material="N-BK7",
    surface_type="toroidal",
    conic=0.0,
    toroidal_coeffs_poly_y=[],
)
toroidal_lens.surfaces.add(index=2, thickness=65)
toroidal_lens.surfaces.add(index=3)

# add aperture
toroidal_lens.set_aperture(aperture_type="EPD", value=20.0)

# add field
toroidal_lens.fields.set_type(field_type="angle")
toroidal_lens.fields.add(y=0)

# add wavelength
toroidal_lens.wavelengths.add(value=0.587, is_primary=True)
[5]:
toroidal_lens.draw(num_rays=10, projection="YZ")  # default
[5]:
(<Figure size 1000x400 with 1 Axes>, <Axes: xlabel='Z [mm]', ylabel='Y [mm]'>)
../../_images/gallery_miscellaneous_lens_draw_projection_3_1.png

Plotting in the XZ plane shows the focusing behavior in the XZ sagittal plane.

[ ]:
toroidal_lens.draw(num_rays=10, projection="XZ")
(<Figure size 1000x400 with 1 Axes>, <Axes: xlabel='Z [mm]', ylabel='X [mm]'>)
../../_images/gallery_miscellaneous_lens_draw_projection_5_1.png