surfaces.factories.coordinate_system_factory

Coordinate System Factory Module

This module contains the CoordinateSystemFactory class, which is responsible for generating coordinate system instances based on input parameters. The class interfaces with the surface factory to ensure that each surface is assigned the appropriate coordinate system, including positional and rotational attributes.

Kramer Harrison, 2025

Classes

CoordinateSystemFactory(surface_factory)

Factory class for creating CoordinateSystem instances.

class CoordinateSystemFactory(surface_factory)[source]

Factory class for creating CoordinateSystem instances.

This class abstracts the creation of coordinate systems, ensuring that the correct transformations are applied to each surface within an optical system.

create(index, surface_group, **kwargs)[source]

Creates and returns a CoordinateSystem instance.

Parameters:
  • index (int) – The index of the surface within the optical system.

  • surface_group (SurfaceGroup) – The group containing all surfaces.

  • **kwargs

    Additional keyword arguments specifying position and rotation. - x (float): X-coordinate (if absolute positioning is used). - y (float): Y-coordinate (if absolute positioning is used). - z (float): Z-coordinate (if absolute positioning is used). - dx (float): X displacement relative to the previous surface. - dy (float): Y displacement relative to the previous surface. - thickness (float): Thickness of the surface (if relative positioning

    is used).

    • rx (float): Rotation about the X-axis.

    • ry (float): Rotation about the Y-axis.

    • rz (float): Rotation about the Z-axis.

Returns:

The configured coordinate system instance.

Return type:

CoordinateSystem

Raises:

ValueError – If conflicting positional parameters are provided.