visisipy.optiland.surfaces#

Optical surfaces for Optiland.

Classes#

OptilandSurfaceProperty

Descriptor for Optiland surface properties.

OptilandCommonSurfaceParameters

Optiland common surface parameters.

OptilandStandardSurfaceParameters

Optiland standard surface parameters.

OptilandBiconicSurfaceParameters

Optiland biconic surface parameters.

OptilandZernikeSurfaceParameters

Optiland Zernike surface parameters.

BaseOptilandSurface

Base class for Optiland surfaces.

OptilandSurface

Sequential surface in Optiland.

OptilandBiconicSurface

Biconic surface in Optiland.

OptilandZernikeStandardSagSurface

Zernike Standard Sag surface in Optiland.

Functions#

make_surface(→ OptilandSurface)

Create an OptilandSurface instance from a given Surface instance.

Module Contents#

class visisipy.optiland.surfaces.OptilandSurfaceProperty(name: str)#

Bases: Generic[PropertyType]

Descriptor for Optiland surface properties.

This descriptor is used to access and set properties of the Optiland surface.

class visisipy.optiland.surfaces.OptilandCommonSurfaceParameters#

Bases: visisipy.types.TypedDict

Optiland common surface parameters.

class visisipy.optiland.surfaces.OptilandStandardSurfaceParameters#

Bases: OptilandCommonSurfaceParameters

Optiland standard surface parameters.

class visisipy.optiland.surfaces.OptilandBiconicSurfaceParameters#

Bases: OptilandCommonSurfaceParameters

Optiland biconic surface parameters.

class visisipy.optiland.surfaces.OptilandZernikeSurfaceParameters#

Bases: OptilandStandardSurfaceParameters

Optiland Zernike surface parameters.

class visisipy.optiland.surfaces.BaseOptilandSurface#

Bases: visisipy.models.BaseSurface, abc.ABC

Base class for Optiland surfaces.

property surface: optiland.surfaces.Surface | None#

Optiland surface object.

This property only has a value if the surface has been built.

property comment: str#

Comment for the surface.

property material: visisipy.models.materials.MaterialModel | str | None#

Material of the surface.

property is_stop: bool#

Flag indicating if the surface is a stop.

property thickness: float#

Thickness of the surface.

property semi_diameter: float | None#

Semi-diameter of the surface.

class visisipy.optiland.surfaces.OptilandSurface(comment: str, *, radius: float = float('inf'), thickness: float = 0.0, semi_diameter: float | None = None, conic: float = 0.0, material: visisipy.models.materials.MaterialModel | str | None = None, is_stop: bool | None = None)#

Bases: BaseOptilandSurface

Sequential surface in Optiland.

Note that, unlike OpticStudio surfaces, it is not possible to update surfaces after they have been built.

property radius: float#

Radius of the surface.

property conic: float#

Conic constant of the surface.

build(optic: optiland.optic.Optic, *, position: int, replace_existing: bool = False) int#

Create the surface in Optiland.

Create the surface in the provided Optic object at the specified position. By default, a new surface will be created. If replace_existing is True, the existing surface at the specified position will be replaced.

Parameters:
opticOptic

The Optic object to which the surface will be added.

positionint

The index at which the surface will be added, starting at 0 for the object surface.

replace_existingbool

If True, replace an existing surface instead of inserting a new one. Defaults to False.

Returns:
int

The index of the created surface. Subsequent surfaces should be after this index.

class visisipy.optiland.surfaces.OptilandBiconicSurface(comment: str, *, radius: float = float('inf'), radius_x: float = float('inf'), thickness: float = 0.0, semi_diameter: float | None = None, conic: float = 0.0, conic_x: float = 0.0, material: visisipy.models.materials.MaterialModel | str | None = None, is_stop: bool | None = None)#

Bases: BaseOptilandSurface

Biconic surface in Optiland.

property radius: float#

Radius of the surface in the Y direction.

property conic: float#

Conic constant of the surface in the X direction.

property radius_x: float#

Radius of the surface in the X direction.

property conic_x: float#

Conic constant of the surface in the X direction.

build(optic: optiland.optic.Optic, *, position: int, replace_existing: bool = False) int#

Create the surface in Optiland.

Create the surface in the provided Optic object at the specified position. By default, a new surface will be created. If replace_existing is True, the existing surface at the specified position will be replaced.

Parameters:
opticOptic

The Optic object to which the surface will be added.

positionint

The index at which the surface will be added, starting at 0 for the object surface.

replace_existingbool

If True, replace an existing surface instead of inserting a new one. Defaults to False.

Returns:
int

The index of the created surface. Subsequent surfaces should be after this index.

class visisipy.optiland.surfaces.OptilandZernikeStandardSagSurface(comment: str, *, radius: float = float('inf'), thickness: float = 0.0, semi_diameter: float | None = None, conic: float = 0.0, material: visisipy.models.materials.MaterialModel | str | None = None, is_stop: bool | None = None, number_of_terms: int = 0, norm_radius: float = 100, zernike_coefficients: visisipy.wavefront.ZernikeCoefficients | dict[int, float] | None = None)#

Bases: BaseOptilandSurface

Zernike Standard Sag surface in Optiland.

property radius: float#

Radius of the surface.

property conic: float#

Conic constant of the surface.

property norm_radius: float#

Normalization radius of the Zernike surface.

property coefficients: visisipy.wavefront.ZernikeCoefficients#

Zernike coefficients of the surface.

build(optic: optiland.optic.Optic, *, position: int, replace_existing: bool = False) int#

Create the surface in Optiland.

Create the surface in the provided Optic object at the specified position. By default, a new surface will be created. If replace_existing is True, the existing surface at the specified position will be replaced.

Parameters:
opticOptic

The Optic object to which the surface will be added.

positionint

The index at which the surface will be added, starting at 0 for the object surface.

replace_existingbool

If True, replace an existing surface instead of inserting a new one. Defaults to False.

Returns:
int

The index of the created surface. Subsequent surfaces should be after this index.

visisipy.optiland.surfaces.make_surface(surface: visisipy.models.geometry.Surface, material: str | visisipy.models.materials.MaterialModel, comment: str = '') OptilandSurface#

Create an OptilandSurface instance from a given Surface instance.

Parameters:
surfaceSurface

The Surface instance from which to create the OptilandSurface instance.

materialstr | MaterialModel

The material of the surface. This can be either a string representing the name of the material or a MaterialModel instance.

commentstr, optional

A comment to be associated with the surface. This is an empty string by default.

Returns:
OptilandSurface

The created OptilandSurface instance.