visisipy.opticstudio.surfaces#

Optical surfaces for OpticStudio.

Classes#

OpticStudioSurface

Sequential surface in OpticStudio.

OpticStudioZernikeStandardSagSurface

Zernike Standard Sag surface in OpticStudio.

Functions#

make_surface(→ OpticStudioSurface)

Create an OpticStudioSurface instance from a given Surface instance.

Module Contents#

class visisipy.opticstudio.surfaces.OpticStudioSurface(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: visisipy.models.base.BaseSurface

Sequential surface in OpticStudio.

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

Material of the surface.

property surface: zospy.api._ZOSAPI.Editors.LDE.ILDERow | None#

OpticStudio surface object.

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

build(oss: zospy.zpcore.OpticStudioSystem, *, position: int, replace_existing: bool = False) int#

Create the surface in OpticStudio.

Create the surface in the provided OpticStudioSystem oss at index position. By default, a new surface will be created. An existing surface will be overwritten if replace_existing is set to True.

Parameters:
osszospy.zpcore.OpticStudioSystem

OpticStudio system in which the surface is created.

positionint

Index at which the surface is located, 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 added after this index.

Link an OpticStudio surface based on its comment.

Searches for a surface in oss whose comment matches self.comment. This surface is assigned to self.surface. If no surface is found or multiple surfaces are found, self.surface is not updated.

Parameters:
osszospy.zpcore.OpticStudioSystem

OpticStudio system in which the eye model is defined.

Returns:
bool

True if the operation succeeded, False if the system has not been built, or no / multiple surfaces have been found.

class visisipy.opticstudio.surfaces.OpticStudioZernikeStandardSagSurface(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, extrapolate: int = 0, zernike_decenter_x: float = 0.0, zernike_decenter_y: float = 0.0, number_of_terms: int = 0, norm_radius: float = 100, zernike_coefficients: visisipy.models.geometry.ZernikeCoefficients | None = None)#

Bases: BaseOpticStudioZernikeSurface

Zernike Standard Sag surface in OpticStudio.

build(oss: zospy.zpcore.OpticStudioSystem, *, position: int, replace_existing: bool = False) int#

Create the surface in OpticStudio.

Create the surface in the provided OpticStudioSystem oss at index position. By default, a new surface will be created. An existing surface will be overwritten if replace_existing is set to True.

Parameters:
osszospy.zpcore.OpticStudioSystem

OpticStudio system in which the surface is created.

positionint

Index at which the surface is located, 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 added after this index.

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

Create an OpticStudioSurface instance from a given Surface instance.

Parameters:
surfaceSurface

The Surface instance from which to create the OpticStudioSurface 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:
OpticStudioSurface

The created OpticStudioSurface instance.