AbstractRegularPolygonalAperture#
- class optika.apertures.AbstractRegularPolygonalAperture(*, samples_wire=101, active=True, inverted=False, transformation=None, kwargs_plot=None)[source]#
Bases:
AbstractPolygonalApertureAn interface describing a regular polygonal aperture.
Attributes
Whether the aperture is active and can clip rays.
The lower-left corner of the aperture's rectangular footprint
The upper-right corner of the aperture's rectangular footprint
Whether this object is being used as an aperture or obscuration.
Extra keyword arguments that will be used in the call to
named_arrays.plt.plot()within theplot()method.Number of vertices in this polygon.
The radial distance from the origin to each vertex.
The default number of samples used for
wire().The array shape of this object.
The transformation between the local surface coordinates and the aperture.
The vertices of the polygon representing this aperture
Methods
__init__(*[, samples_wire, active, ...])clip_rays(rays)Given a set of input rays, update the
unvignettedto beFalseif the ray is blocked by the aperture.plot([ax, transformation, components, sag])Plot the selected components onto the given axes.
to_dxf(file, unit[, transformation])to_string([prefix])Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.wire([num])The sequence of points representing this aperture
Inheritance Diagram

- Parameters:
samples_wire (int)
active (bool | AbstractScalar)
inverted (bool | AbstractScalar)
transformation (None | AbstractTransformation)
kwargs_plot (None | dict)
- clip_rays(rays)#
Given a set of input rays, update the
unvignettedto beFalseif the ray is blocked by the aperture.- Parameters:
rays (RayVectorArray) – The input rays to clip.
- plot(ax=None, transformation=None, components=None, sag=None, **kwargs)#
Plot the selected components onto the given axes.
- Parameters:
ax (None | Axes | ScalarArray[ndarray[tuple[Any, ...], dtype[_ScalarT]]]) – The matplotlib axes to plot onto
transformation (None | AbstractTransformation) – Any extra transformations to apply to the coordinate system before plotting
components (None | tuple[str, ...]) – Which 3d components to plot, helpful if plotting in 2d.
kwargs – Additional keyword arguments that will be passed along to
named_arrays.plt.plot()sag (None | AbstractSag)
- Return type:
None | ScalarArray[ndarray[tuple[Any, …], dtype[None | Line2D]]]
- to_dxf(file, unit, transformation=None)#
- Parameters:
file (Path)
unit (Unit)
transformation (None | AbstractTransformation)
- to_string(prefix=None)#
Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.
- wire(num=None)#
The sequence of points representing this aperture
- Parameters:
num (None | int) – The total number of samples that will be used to represent this wire.
- Return type:
- active: bool | AbstractScalar = True#
Whether the aperture is active and can clip rays.
- property bound_lower: AbstractCartesian3dVectorArray#
The lower-left corner of the aperture’s rectangular footprint
- property bound_upper: AbstractCartesian3dVectorArray#
The upper-right corner of the aperture’s rectangular footprint
- inverted: bool | AbstractScalar = False#
Whether this object is being used as an aperture or obscuration.
If
True, the interior of the aperture allows light to passthrough. IfFalse, the exterior of the aperture allows light to pass through.
- kwargs_plot: None | dict = None#
Extra keyword arguments that will be used in the call to
named_arrays.plt.plot()within theplot()method.
- abstract property radius: int | float | complex | ndarray | Quantity | AbstractScalar#
The radial distance from the origin to each vertex.
- transformation: None | AbstractTransformation = None#
The transformation between the local surface coordinates and the aperture.
- property vertices: AbstractCartesian3dVectorArray#
The vertices of the polygon representing this aperture