pyoptools.raytrace.surface.opticalstop module¶
- pyoptools.raytrace.surface.opticalstop.Aperture(*args, **kwargs)¶
Deprecated: Use OpticalStop instead.
This function provides backwards compatibility for existing code using the Aperture class. It creates an OpticalStop instance and emits a deprecation warning.
- Parameters:
*args – Arguments passed through to OpticalStop constructor.
**kwargs – Arguments passed through to OpticalStop constructor.
- Returns:
An OpticalStop instance.
- Return type:
Warning
- DeprecationWarning
Always emitted when this function is called.
- class pyoptools.raytrace.surface.opticalstop.OpticalStop¶
Bases:
PlaneClass to define an optical stop surface.
The OpticalStop class is used to define stops in an optical system. It represents a surface that has an external shape and an optional internal aperture shape that defines a hole in the surface.
- Parameters:
shape (Shape, optional) – An instance of a Shape subclass that defines the external shape of the stop. This parameter is inherited from the Plane class and passed through to it.
ap_shape (Shape, optional) – An instance of a Shape subclass that defines the internal aperture shape (the hole). If None, the stop has no internal aperture and acts as a full stop, blocking rays outside the external shape boundary.
Examples
Creating an optical stop with a rectangular external shape and a circular aperture:
stop = OpticalStop(shape=Rectangular(size=(60, 60)), ap_shape=Circular(radius=2.5))
Creating a full stop with no internal aperture:
full_stop = OpticalStop(shape=Circular(radius=10), ap_shape=None)
Notes
To create a stop component, it is recommended to use the Stop class from the comp_lib module. The Stop class creates the optical stop surface and encapsulates it in a component that can be used within a System.
- ap_shape¶
- propagate(ri, ni, nr)¶
Calculate the refracted ray on a surface.
This method calculates the ray refracted (or both refracted and reflected rays) on a surface.
- Parameters:
incident_ray (Ray) – The incident ray, which must be in the coordinate system of the surface.
ni (double) – The refractive index of the incident medium.
nr (double) – The refractive index of the refracted medium.
- Returns:
A list containing the rays resulting from the ray-surface interaction.
- Return type:
list