pyoptools.raytrace.shape.circular module¶
- class pyoptools.raytrace.shape.circular.Circular¶
Bases:
ShapeClass defining a circular shape.
The Circular class represents a circular aperture or surface shape, defined by a given radius. It inherits from the Shape class and implements methods specific to circular shapes.
- Parameters:
radius (float, optional) – The radius of the circular shape. Defaults to 1.0.
samples (tuple of int, optional) – A tuple (radial_samples, angular_samples) that determines the number of samples used to discretize the circle. radial_samples defines the number of divisions along the radius, and angular_samples defines the number of divisions around the circle. Defaults to (10, 36).
*args (tuple, optional) – Additional positional arguments passed to the Shape superclass.
**kwargs (dict, optional) – Additional keyword arguments passed to the Shape superclass.
- radius¶
The radius of the circular shape.
- Type:
float
- samples¶
A tuple (radial_samples, angular_samples) representing the sampling resolution of the circle.
- Type:
tuple of int
- limits()¶
Return the minimum and maximum limits of the circular aperture.
This method returns the minimum and maximum X and Y coordinates that define the bounding box of the circular aperture. These limits are determined by the radius of the circle.
- Returns:
A tuple (xmin, xmax, ymin, ymax) where: - xmin is the minimum X-coordinate (-self.radius). - xmax is the maximum X-coordinate (self.radius). - ymin is the minimum Y-coordinate (-self.radius). - ymax is the maximum Y-coordinate (self.radius).
- Return type:
tuple of float
Notes
These limits define a square bounding box that fully contains the circular aperture.
- pointlist()¶
Generate a list of points that adequately sample the circular shape.
This method returns two lists, X and Y, representing the X and Y coordinates of points that sample the circular shape. The sampling is based on the number of radial (nr) and angular (na) divisions specified in the samples attribute. The center point (0, 0) is always included in the list.
- Returns:
A tuple (X, Y) where X is a list of X coordinates and Y is a list of Y coordinates for the sampled points on the circular shape.
- Return type:
tuple of lists
Notes
- The samples attribute defines the resolution of the sampling:
nr (number of radial samples) determines the number of points
along the radius of the circle. - na (number of angular samples) determines the number of points around the circle’s circumference.
The point (0, 0) is always included at the start of the lists.
- radius¶
- samples¶