RegularPolygon¶
- class kgpy.optics.apertures.RegularPolygon(plot_kwargs=<factory>, transform=<factory>, num_samples=1000, is_active=True, is_obscuration=False, radius=<Quantity 0. mm>, num_sides=8, offset_angle=<Quantity 0. deg>)¶
Bases:
Polygon- Parameters:
transform (TransformList) –
num_samples (int) –
is_active (bool) –
is_obscuration (int | float | ndarray | Quantity | AbstractArray) –
radius (int | float | ndarray | Quantity | AbstractArray | AbstractArray) –
num_sides (int) –
offset_angle (int | float | ndarray | Quantity | AbstractArray | AbstractArray) –
- __init__(plot_kwargs=<factory>, transform=<factory>, num_samples=1000, is_active=True, is_obscuration=False, radius=<Quantity 0. mm>, num_sides=8, offset_angle=<Quantity 0. deg>)¶
- Parameters:
transform (TransformList) –
num_samples (int) –
is_active (bool) –
is_obscuration (int | float | ndarray | Quantity | AbstractArray) –
radius (int | float | ndarray | Quantity | AbstractArray | AbstractArray) –
num_sides (int) –
offset_angle (int | float | ndarray | Quantity | AbstractArray | AbstractArray) –
- Return type:
None
Attributes
Calculate the angle subtended by each edge of the polygon by dividing the angle of a circle (360 degrees) by the number of sides in the regular polygon.
Calculate the angle subtended between a vertex and a point on the center of an edge.
Calculate the distance from the center of the polygon to the center of an edge of a polygon.
Methods
__init__([plot_kwargs, transform, ...])copy()- rtype:
typing.TypeVar(CopyableT, bound= Copyable)
- rtype:
typing.TypeVar(CopyableT, bound= Copyable)
is_unvignetted(position)plot(ax[, component_x, component_y, ...])- rtype:
write_to_dxf(file_writer, unit[, ...])- rtype:
Inheritance Diagram
digraph inheritance0ed0b1cd7c { bgcolor=transparent; rankdir=TB; size="8.0, 12.0"; "abc.ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "kgpy.io.dxf.WritableMixin" [URL="kgpy.io.dxf.WritableMixin.html#kgpy.io.dxf.WritableMixin",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="WritableMixin()"]; "abc.ABC" -> "kgpy.io.dxf.WritableMixin" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.mixin.Broadcastable" [URL="kgpy.mixin.Broadcastable.html#kgpy.mixin.Broadcastable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class to help with determining the shape of the optical configuration."]; "kgpy.mixin.Copyable" [URL="kgpy.mixin.Copyable.html#kgpy.mixin.Copyable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "abc.ABC" -> "kgpy.mixin.Copyable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.mixin.Plottable" [URL="kgpy.mixin.Plottable.html#kgpy.mixin.Plottable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Plottable(plot_kwargs: Dict[str, Any] = <factory>)"]; "kgpy.mixin.Copyable" -> "kgpy.mixin.Plottable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "abc.ABC" -> "kgpy.mixin.Plottable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.optics.apertures.Aperture" [URL="kgpy.optics.apertures.Aperture.html#kgpy.optics.apertures.Aperture",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Aperture(plot_kwargs: Dict[str, Any] = <factory>, transform: kgpy.transforms.TransformList = <factory>, num_samples: int = 1000, is_active: bool = True)"]; "kgpy.io.dxf.WritableMixin" -> "kgpy.optics.apertures.Aperture" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.transforms.Transformable" -> "kgpy.optics.apertures.Aperture" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.mixin.Broadcastable" -> "kgpy.optics.apertures.Aperture" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.mixin.Plottable" -> "kgpy.optics.apertures.Aperture" [arrowsize=0.5,style="setlinewidth(0.5)"]; "abc.ABC" -> "kgpy.optics.apertures.Aperture" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.optics.apertures.Obscurable" [URL="kgpy.optics.apertures.Obscurable.html#kgpy.optics.apertures.Obscurable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Obscurable(plot_kwargs: Dict[str, Any] = <factory>, transform: kgpy.transforms.TransformList = <factory>, num_samples: int = 1000, is_active: bool = True, is_obscuration: Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray] = False)"]; "kgpy.optics.apertures.Aperture" -> "kgpy.optics.apertures.Obscurable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.optics.apertures.Polygon" [URL="kgpy.optics.apertures.Polygon.html#kgpy.optics.apertures.Polygon",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Polygon(plot_kwargs: Dict[str, Any] = <factory>, transform: kgpy.transforms.TransformList = <factory>, num_samples: int = 1000, is_active: bool = True, is_obscuration: Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray] = False)"]; "kgpy.optics.apertures.Obscurable" -> "kgpy.optics.apertures.Polygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "abc.ABC" -> "kgpy.optics.apertures.Polygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.optics.apertures.RegularPolygon" [URL="kgpy.optics.apertures.RegularPolygon.html#kgpy.optics.apertures.RegularPolygon",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="RegularPolygon(plot_kwargs: Dict[str, Any] = <factory>, transform: kgpy.transforms.TransformList = <factory>, num_samples: int = 1000, is_active: bool = True, is_obscuration: Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray] = False, radius: Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 0. mm>, num_sides: int = 8, offset_angle: Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 0. deg>)"]; "kgpy.optics.apertures.Polygon" -> "kgpy.optics.apertures.RegularPolygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.transforms.Transformable" [URL="kgpy.transforms.Transformable.html#kgpy.transforms.Transformable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Transformable(transform: kgpy.transforms.TransformList = <factory>)"]; }- copy()¶
- Return type:
typing.TypeVar(CopyableT, bound= Copyable)- Parameters:
self (CopyableT) –
- copy_shallow()¶
- Return type:
typing.TypeVar(CopyableT, bound= Copyable)- Parameters:
self (CopyableT) –
- is_unvignetted(position)¶
- Return type:
typing.Union[int,float,numpy.ndarray,astropy.units.quantity.Quantity,kgpy.labeled.AbstractArray,kgpy.uncertainty.AbstractArray]- Parameters:
self (PolygonT) –
position (Cartesian2D) –
- plot(ax, component_x='x', component_y='y', component_z=None, transform_extra=None, sag=None, **kwargs)¶
- Return type:
- Parameters:
- write_to_dxf(file_writer, unit, transform_extra=None, sag=None)¶
- Return type:
- Parameters:
self (ApertureT) –
file_writer (R12FastStreamWriter) –
unit (Unit) –
transform_extra (AbstractTransform | None) –
sag (Sag | None) –
- property broadcasted¶
- property edge_subtent: int | float | ndarray | Quantity | AbstractArray¶
Calculate the angle subtended by each edge of the polygon by dividing the angle of a circle (360 degrees) by the number of sides in the regular polygon. :return: Angle subtended by each edge
- property half_edge_subtent: int | float | ndarray | Quantity | AbstractArray¶
Calculate the angle subtended between a vertex and a point on the center of an edge. This is sometimes a more useful quantity than the subtent of an entire edge. :return:
- is_active: bool = True¶
- is_obscuration: kgpy.labeled.ArrayLike = False¶
- property max: Cartesian3D¶
- property min: Cartesian3D¶
- property min_radius: int | float | ndarray | Quantity | AbstractArray | AbstractArray¶
Calculate the distance from the center of the polygon to the center of an edge of a polygon. :return: The minimum radius of the polygon.
- num_samples: int = 1000¶
-
offset_angle:
typing.Union[int,float,numpy.ndarray,astropy.units.quantity.Quantity,kgpy.labeled.AbstractArray,kgpy.uncertainty.AbstractArray] = <Quantity 0. deg>¶
- plot_kwargs: typ.Dict[str, typ.Any]¶
-
radius:
typing.Union[int,float,numpy.ndarray,astropy.units.quantity.Quantity,kgpy.labeled.AbstractArray,kgpy.uncertainty.AbstractArray] = <Quantity 0. mm>¶
- property shape¶
- property shapely_poly: Polygon¶
- transform: TransformList¶
- property vertices: Cartesian3D¶
- property wire: Cartesian3D¶