visualization.system.system
System Visualization Module
This module contains the OpticalSystem class for visualizing optical systems.
Kramer Harrison, 2024
Classes
|
A class to represent an optical system for visualization. |
- class OpticalSystem(optic, rays, projection='2d')[source]
A class to represent an optical system for visualization. The optical system contains surfaces and lenses.
- Parameters:
optic (Optic) – The optical system to be used for plotting.
rays (Rays) – The rays interacting with the optical system.
projection (str) – The type of projection for visualization. Must be ‘2d’ or ‘3d’.
- rays
The rays interacting with the optical system.
- Type:
Rays
- projection
The type of projection for visualization. Must be ‘2d’ or ‘3d’.
- Type:
str
- components
A list to store the components of the optical system.
- Type:
list
- component_registry
A registry mapping component names to their respective classes for 2D and 3D projections.
- Type:
dict
- plot(ax)[source]
- Identifies and plots the components of the optical system on the
given axis (or renderer for 3D plotting).
- plot(ax, theme=None, projection='YZ', show_apertures=True)[source]
Plots the components of the optical system on the given axis (or renderer for 3D plotting).
- classmethod register_component_renderer(component_type: str, renderer: ComponentRenderer, *, overwrite: bool = False) None[source]
Register a renderer for a custom component type.
The registered renderer is used when
_identify_componentsadds a component of this type. Custom types are checked before the built-in registry, so this can also override existing built-in types whenoverwrite=True.- Parameters:
component_type – String key identifying the component type.
renderer – A ComponentRenderer instance.
overwrite – Allow replacing an existing registration.
- Raises:
ValueError – If component_type is already registered and overwrite is False.