geometries.biconic
Biconic Geometry
The biconic geometry represents a surface defined by:
zx = (cx * x^2) / (1 + sqrt(1 - (1 + kx) * cx^2 * x^2)) zy = (cy * y^2) / (1 + sqrt(1 - (1 + ky) * cy^2 * y^2)) z = zx + zy
where: - cx = 1 / Rx (curvature in x) - cy = 1 / Ry (curvature in y) - kx is the conic constant for the x-profile - ky is the conic constant for the y-profile
A biconic surface is a generalization of a conic surface that allows for independent curvature in the x and y directions. It is commonly used in optical systems where different curvatures are required in orthogonal planes.
Kramer Harrison, 2025
Classes
|
Represents a biconic geometry. |
- class BiconicGeometry(coordinate_system: CoordinateSystem, radius_x: float, radius_y: float, conic_x: float = 0.0, conic_y: float = 0.0, tol: float = 1e-10, max_iter: int = 100)[source]
Represents a biconic geometry.
The sag is defined by the standard sag equation applied independently to the x and y axes. zx = (cx * x^2) / (1 + sqrt(1 - (1 + kx) * cx^2 * x^2)) zy = (cy * y^2) / (1 + sqrt(1 - (1 + ky) * cy^2 * y^2)) z = zx + zy
where: - cx = 1 / Rx (curvature in x) - cy = 1 / Ry (curvature in y) - kx is the conic constant for the x-profile - ky is the conic constant for the y-profile
- distance(rays)
Calculates the distance from the ray origin to the surface intersection using a robust Newton-Raphson method. This version uses the base conic intersection as a strong initial guess.
- Parameters:
rays (RealRays) – The rays used for calculating distance.
- Returns:
An array of propagation distances ‘t’ from each ray’s current position to its intersection point with the geometry.
- Return type:
be.ndarray
- flip()[source]
Flip the geometry.
Changes the sign of the radii of curvature Rx and Ry. Updates the curvature attributes cx and cy accordingly. The conic constants kx and ky remain unchanged.
- classmethod from_dict(data: dict) BiconicGeometry[source]
Creates a BiconicGeometry from a dictionary representation.
- Parameters:
data (dict) – The dictionary representation of the biconic surface, containing keys like ‘cs’, ‘radius_x’, ‘radius_y’, ‘conic_x’, ‘conic_y’.
- Returns:
An instance of BiconicGeometry.
- Return type:
- globalize(rays)
Convert rays from the local coordinate system to the global coordinate system.
- Parameters:
rays (RealRays) – The rays to convert.
- localize(rays)
Convert rays from the global coordinate system to the local coordinate system.
- Parameters:
rays (RealRays) – The rays to convert.
- sag(x=0, y=0)[source]
Calculate the surface sag of the geometry.
- Parameters:
x (float or be.ndarray, optional) – The x-coordinate(s). Defaults to 0.
y (float or be.ndarray, optional) – The y-coordinate(s). Defaults to 0.
- Returns:
The sag value(s) at the given coordinates.
- Return type:
be.ndarray or float
- scale(scale_factor: float)[source]
Scale the geometry parameters.
- Parameters:
scale_factor (float) – The factor by which to scale the geometry.
- set_radius(value: float) None
Set the radius of curvature.
- Parameters:
value (float) – The new radius of curvature.
- surface_normal(rays)
Calculates the surface normal of the geometry at the given rays.
- Parameters:
rays (RealRays) – The rays, positioned at the surface, for which to calculate the surface normal.
- Returns:
The surface normal components (nx, ny, nz).
- Return type:
tuple[be.ndarray, be.ndarray, be.ndarray]
- to_dict() dict[source]
Converts the geometry to a dictionary.
- Returns:
The dictionary representation of the geometry.
- Return type:
dict
- update_normalization(semi_aperture: float) None
Update the normalization attributes of the geometry based on its defined normalization_mode (‘auto’ or ‘manual’). Base geometry generally does not maintain a normalization radius.
- Parameters:
semi_aperture (float) – The current semi-aperture of the surface.