Lens Data Editor (LDE) Functions#

These lens data editor (LDE) functions pertain to building/modifying sequential Zemax lens files.

skZemax.skZemax_subfunctions._LDE_functions.LDE_AddNewSurface(self) ZOSAPI_Editors_LDE_ILDERow[source]#

Adds a new surface to the end of the system

Returns:

The surface object of the newly made surface.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_BuildRayTraceNormalizedUnpolarizedRays(self, Hx: ndarray = array([0]), Hy: ndarray = array([0]), Px: ndarray = array([1., 0.96858316, 0.87630668, 0.72896863, 0.53582679, 0.30901699, 0.06279052, -0.18738131, -0.42577929, -0.63742399, -0.80901699, -0.92977649, -0.9921147, -0.9921147, -0.92977649, -0.80901699, -0.63742399, -0.42577929, -0.18738131, 0.06279052, 0.30901699, 0.53582679, 0.72896863, 0.87630668, 0.96858316]), Py: ndarray = array([0., 0.24868989, 0.48175367, 0.68454711, 0.84432793, 0.95105652, 0.99802673, 0.98228725, 0.90482705, 0.77051324, 0.58778525, 0.36812455, 0.12533323, -0.12533323, -0.36812455, -0.58778525, -0.77051324, -0.90482705, -0.98228725, -0.99802673, -0.95105652, -0.84432793, -0.68454711, -0.48175367, -0.24868989]), ending_surface: int | ZOSAPI_Editors_LDE_ILDERow = None, do_all_surfaces_to_ending: bool = True, wavelengths: int | ZOSAPI_SystemData_IWavelength | list[int, ZOSAPI_SystemData_IWavelength] | ndarray[int, ZOSAPI_SystemData_IWavelength] = None, trace_wavelengths_individually: bool = True, ray_type: str = 'Real', OPD_mode: str = 'None', should_meshgrid: bool = True) Dataset[source]#

This function sets up custom unpolarized rays in Zemax’s normalized coordiante system. These rays are intended to be used in an skZemax sequential ray trace executed with LDE_RunRayTrace().

In this system a single ray is defined by a starting position at the front of the optical system (Hx, Hy), and a point on the entrence pupil to travel through (Px, Py).

A grid of rays - defined by Hx and Hy - are built in a normalized coordianate as input to the optical system. There are two normalized systems - set by Field_SetNormalization():

Radial:

If the field normalization is radial, then the normalized field coordinates represent points on a unit circle. The radius of this unit circle, called the maximum radial field, is given by the radius of the field point farthest from the origin in field coordinates. The maximum radial field magnitude is then used to scale all fields to normalized field coordinates. Real field coordinates can be determined by multiplying the normalized coordinates, Hx and Hy, by the maximum radial field magnitude:

\(f_x = (Hx)(F_r)\)

\(f_y = (Hy)(F_r)\)

where \(F_r\) is the maximum radial field magnitude and \(f_x\) and \(f_y\) are the field coordinates in field units.

Rectangular:

If the field normalization is rectangular, then the normalized field coordinates represent points on a unit rectangle. The x and y direction widths of this unit rectangle, called the maximum x field and maximum y field, are defined by the largest absolute magnitudes of all the x and y field coordinates. The maximum x and y field magnitudes are then used to scale all fields to normalized field coordinates. Real field coordinates can be determined by multiplying the normalized coordinates

\(f_x = (Hx)(F_x)\)

\(f_y = (Hy)(F_y)\)

where \(F_x\) and \(F_x\) are the x and y field magnitudes, and \(f_x\) and \(f_y\) are the field coordinates in field units.

This function builds rays such that each - and every - ray defined in the (Hx, Hy) grid at the front is then traced through a positon of the entrance pupil defined also by a normalized system (Px, Py). Unlike the (Hx, Hy) coordiantes, the entrnce pupil is always treated as radial:

The normalized pupil coordinate (0.0, 1.0) is always at the top of the pupil, and therefore defines a marginal ray. The normalized pupil coordinate (0.0, 0.0) always goes through the center of the pupil, and therefore defines a chief ray. The radial size of the pupil is defined by the radius of the paraxial entrance pupil, unless ray aiming is turned on, in which case the radial size of the pupil is given by the radial size of the stop.

This function will build rays for you in this system, based on the inputs of the (Hx, Hy) and (Px, Py) grids. In building both grids the radial constraints (if applicable) are handled for you and any input with a magnitude greater than 1 are filtered.

A Final note on calulation of optical path difference (OPD_mode) - which can only be calculated when tracing rays all the way to the image surface:

Computing the OPD takes additional time beyond that for regular ray tracing, and OpticStudio only performs this additional computation if requested to do so. Computing the OPD is also more complicated for the client program, which means two rays must be traced rather than just one. To compute OPD for an arbitrary ray, OpticStudio must trace the chief ray, then the arbitrary ray, then subtract the phase of the two to get the OPD. Rather than trace the same chief ray over and over, which is slow, usually the chief ray is traced once, and then the phase of the chief ray is subtracted from each subsequent ray.

None: no OPD calculation will be performed. It will return the optical path as defined in the Single Ray Trace analysis. That value can differ from other analyses at infinite conjugates.

Current: calculate the OPD based on the current ray and the previously computed chief ray.

CurrentAndChief: will first compute the chief ray, and then calculate the OPD for the current ray.

Parameters:
  • Hx (np.ndarray, optional) – An array of Hx points, defaults to np.array([0])

  • Hy (np.ndarray, optional) – An array of Hy points, defaults to np.array([0])

  • Px (np.ndarray, optional) – An array of Px points, defaults to np.cos(np.linspace(0, 2 * np.pi, 25, endpoint=False))

  • Py (np.ndarray, optional) – An array of Py points, defaults to np.sin(np.linspace(0, 2 * np.pi, 25, endpoint=False))

  • ending_surface (Union[int, ZOSAPI_Editors_LDE_ILDERow], optional) – The surface to trace the rays up to (object or as an index), defaults to None (takes the last surface)

  • do_all_surfaces_to_ending (bool, optional) – If True will do ray trace for all surfaces up-to the ending one, else will only do the ending, defaults to True

  • wavelengths (Union[int, ZOSAPI_SystemData_IWavelength, list[int, ZOSAPI_SystemData_IWavelength], np.ndarray[int, ZOSAPI_SystemData_IWavelength]], optional) – Wavelength(s) of the system to trace (object or as an index). Recommended to have len(wavelengths)<=24 for speed. If more are needed, repeat this in blocks of 24, defaults to None (takes primary wavelength)

  • trace_wavelengths_individually (bool, optional) – If True will trace each wavelength individually, else will trace the aggregate, defaults to True

  • ray_type (str, optional) – Type of ray tracing to do. Options are “Real” or “Paraxial”. “Paraxial” applies small angle approximations to snell’s law for speed where “Real” does not, defaults to “Real”

  • OPD_mode (str, optional) – The type of OPD scheme to apply (see desciprtion above), defaults to ‘None’

  • should_meshgrid (bool, optional) – If True a ray for every Hx and Hy pair will be made for every pair of Px and Py, else the Hx, Hy, Px, and Py arrays will be taken directly, defaults to True

Returns:

An xarray of rays ready to be traced by LDE_RunRayTrace()

Return type:

xr.Dataset

skZemax.skZemax_subfunctions._LDE_functions.LDE_ChangeApertureToCircular(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, MinimumRadius: float = 0.0, MaximumRadius: float = 10.0, ApertureXDecenter: float = 0.0, ApertureYDecenter: float = 0.0) ZOSAPI_Editors_LDE_ILDERow[source]#

Changes the aperture of the surface to a circular one with specified radii.

A Circular Aperture defines an annular region which vignettes all rays which strike the surface inside of the minimum radius, and outside of the maximum radius. If the ray is between the minimum and maximum radii, then the ray will be allowed to proceed.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • MinimumRadius (float, optional) – The minimum radius of the aperture, defaults to 0.0

  • MaximumRadius (float, optional) – The maximum radius of the aperture, defaults to 10.0

  • ApertureXDecenter (float, optional) – The decenter in the x-direction of the aperture, defaults to 0.0

  • ApertureYDecenter (float, optional) – The decenter in the y-direction of the aperture, defaults to 0.0

Returns:

The surface object.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_ChangeApertureToCircularObscuration(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, MinimumRadius: float = 0.0, MaximumRadius: float = 10.0, ApertureXDecenter: float = 0.0, ApertureYDecenter: float = 0.0) ZOSAPI_Editors_LDE_ILDERow[source]#

Changes the aperture of the surface to a circular obscuration one with specified radii.

The Circular Obscuration is the complement of the Circular Aperture. If the ray is NOT between the minimum and maximum radii, then the ray will be allowed to proceed.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • MinimumRadius (float, optional) – The minimum radius of the aperture, defaults to 0.0

  • MaximumRadius (float, optional) – The maximum radius of the aperture, defaults to 10.0

  • ApertureXDecenter (float, optional) – The decenter in the x-direction of the aperture, defaults to 0.0

  • ApertureYDecenter (float, optional) – The decenter in the y-direction of the aperture, defaults to 0.0

Returns:

The surface object.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_ChangeApertureToFloating(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) ZOSAPI_Editors_LDE_ILDERow[source]#

Changes the aperture of the surface to a Floating one.

A floating aperture is very similar to the circular aperture, except the minimum radius is always zero, and the maximum radius is always equal to the clear semi-diameter or semi-diameter of the surface. Since the clear semi-diameter or semi-diameter value may be adjusted by OpticStudio (when in automatic mode) the aperture value “floats” as the clear semi-diameter or semi-diameter value. The floating aperture is useful when macros or external programs use OpticStudio to trace rays that may lie outside of the default clear semi-diameters or semi-diameters, and these rays are to be vignetted.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

The surface object.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_ChangeApertureToRectangular(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, XHalfWidth: float = 10.0, YHalfWidth: float = 10.0, ApertureXDecenter: float = 0.0, ApertureYDecenter: float = 0.0) ZOSAPI_Editors_LDE_ILDERow[source]#

Changes the aperture of the surface to a rectangular one with specified widths Rays are vignetted which intercept the surface outside the rectangular region defined by the half widths in x and y.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • XHalfWidth (float, optional) – The half-width in the x-direction of the aperture, defaults to 10.0

  • YHalfWidth (float, optional) – The half-width in the y-direction of the aperture, defaults to 10.0

  • ApertureXDecenter (float, optional) – The decenter in the x-direction of the aperture, defaults to 0.0

  • ApertureYDecenter (float, optional) – The decenter in the y-direction of the aperture, defaults to 0.0

Returns:

The surface object.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_ChangeSurfaceType(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, surface_type: str) ZOSAPI_Editors_LDE_ILDERow[source]#

This function changes the surface type of a (sequential) surface element in the lens data editor.

Surface types are described in Zemax documentation, and can be named by the LDE_GetNamesOfAllSurfaceTypes() function.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • surface_type (str) – A string identifying the surface type to change it to.

Returns:

The surface object being operated on.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_CheckIfSurfaceIsStop(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) bool[source]#

Checks if the given surface is the stop of the system.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

True if the surface is the system stop.

Return type:

bool

skZemax.skZemax_subfunctions._LDE_functions.LDE_CopyAndInsertSurfacesFromFile(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, path_to_file: str, first_surface_to_copy: int, number_surfaces_to_copy: int) None[source]#

Copies surfaces from another .zmx file and insert them into the current one. Surfaces of first_surface_to_copy to (first_surface_to_copy + number_surfaces_to_copy) are inserted in the current file beginning at in_Surface.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – Location in the active file to begin inserting surfaces.

  • path_to_file (str) – Path to another Zemax file from which to copy some surface elements.

  • first_surface_to_copy (int) – The first surface in the external Zemax file to copy over into the currently active one.

  • number_surfaces_to_copy (int) – The number of surfaces after first_surface_to_copy to copy over along with it.

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetAllColumnDataOfSurface(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) dict[source]#

Gets all column data of a Sequential surface and returns it as a dict.

This was made to reflect the functions of NCE_GetAllColumnDataOfObject() and NCE_SetAllColumnDataOfObjectFromDict() which are for robustness in Non-sequential mode. However, unlike Non-sequential mode, Sequential mode seems to work as the API intended so you don’t need to use these lower level dict functions to adjust surface properties.

However, it is still very useful to set properties through this mechanism in python code.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

dict of the surface’s column data.

Return type:

dict

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetApertureAsCircularObscurationType(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) dict[source]#

This function returns the aperture settings of this object interpreted as a CircularObscuration aperture by Zemax. Note that this does not nesscarly mean the aperture is currently set to be CircularObscuration, but rather these are the current settings it would have if it were. If the surface is this type of aperture, then these are the settings it has.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

A dict of the CircularObscuration aperture settings

Return type:

dict

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetApertureAsCircularType(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) dict[source]#

This function returns the aperture settings of this object interpreted as a Circular aperture by Zemax. Note that this does not nesscarly mean the aperture is currently set to be Circular, but rather these are the current settings it would have if it were. If the surface is this type of aperture, then these are the settings it has.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

A dict of the Circular aperture settings

Return type:

dict

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetApertureAsRectangularType(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) dict[source]#

This function returns the aperture settings of this object interpreted as a Rectangular aperture by Zemax. Note that this does not nesscarly mean the aperture is currently set to be Rectangular, but rather these are the current settings it would have if it were. If the surface is this type of aperture, then these are the settings it has.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

A dict of the Rectangular aperture settings

Return type:

dict

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetApertureTypeSettings(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, aperture_type: str) ZOSAPI_Editors_LDE_ISurfaceApertureType[source]#

Note that while this is available to a user for customized implantation, it is recommended to go through a pre-defined function like LDE_ChangeApertureToRectangular()/LDE_GetApertureAsRectangularType() or LDE_ChangeApertureToCircular()/LDE_GetApertureAsCircularType() to change/get the aperture settings.

This function gets the aperture type settings of the surface. Generally this is to change a LDE surface’s aperture. If you want to get the aperture type of the surface use LDE_GetSurfaceApertureType().

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • aperture_type (str) – A string identifying the aperture type to change it to.

Returns:

The settings of the aperture to change.

Return type:

ZOSAPI_Editors_LDE_ISurfaceApertureType

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetNamesOfAllApertureTypes(self, print_to_console: bool = False) list[source]#

This function is simply for user convenance to look up the ZOS-API names of all aperture types. This can be useful to look up what one may want to code as input to functions like LDE_GetApertureTypeSettings().

Parameters:

print_to_console (bool, optional) – If True will print to console, defaults to False

Returns:

A list of the names of all aperture types the ZOS-API knows.

Return type:

list

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetNamesOfAllSurfaceTypes(self, print_to_console: bool = False) list[source]#

This function is simply for user convenance to look up the ZOS-API names of all surface types. This can be useful to look up what one may want to code as input to functions like LDE_ChangeSurfaceType().

Parameters:

print_to_console (bool, optional) – If True will print to console, defaults to False

Returns:

A list of the names of all surface types the ZOS-API knows.

Return type:

list

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetNumberOfSurfaces(self) int[source]#

Gets the number of surfaces in the LDE

Returns:

The total number of (sequential) surfaces in the lens data editor (LDE)

Return type:

int

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetObjectRotationAndPositionMatrices(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) tuple[ndarray, ndarray][source]#

Looks up an LDE object and returns the object’s rotation matrix and position information w/r to the global coordiante system. See Example 07.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

tuple of object’s ([x, y, z], R matrix) as np.ndarrays

Return type:

tuple[np.ndarray, np.ndarray]

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetStopSurface(self) ZOSAPI_Editors_LDE_ILDERow[source]#

Finds and returns the stop surface of the system

Returns:

The surface object of the stop.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetSurface(self, SurfaceNum: int) ZOSAPI_Editors_LDE_ILDERow[source]#

Returns a surface object at the given index.

Parameters:

SurfaceNum (int) – Surface index number

Returns:

The object of the surface at index.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetSurfaceApertureType(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) str[source]#

This function returns the type of aperture the given surface is.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

Returns:

The name of the aperture type

Return type:

str

skZemax.skZemax_subfunctions._LDE_functions.LDE_GetSurfaceColumnEnum(self, in_str: str, in_Surface: None | int | ZOSAPI_Editors_LDE_ILDERow = None) ZOSAPI_Editors_LDE_SurfaceColumn[source]#

Returns the underlying ZOI-API enumerators of a LDE column matching the input string.

If in_Surface is None, then assuming only searching for a default/base property or one named by ‘par#’. If in_Surface is not None, then will search for the property in the specific surface by name and return the right enum (since different surface types have different names for their columns).

If the given string is able to be matched to more than one column name, then the first column within the names will be given.

Parameters:
  • in_str (str) – The column, by name, to get the ZOI-API enumerator of.

  • in_Surface (Union[None, int, ZOSAPI_Editors_LDE_ILDERow], optional) – The surface to change as an object or as an index, defaults to None

Returns:

the ZOI-API enumerator

Return type:

ZOSAPI_Editors_LDE_SurfaceColumn

skZemax.skZemax_subfunctions._LDE_functions.LDE_InsertNewSurface(self, insertSurface: int | ZOSAPI_Editors_LDE_ILDERow) ZOSAPI_Editors_LDE_ILDERow[source]#

Inserts a new surface at specified location in the LDE.

Parameters:

insertSurface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The location to insert the surface. Specified by either an index or a surface object.

Returns:

The surface object of the newly inserted surface.

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_RemoveSurface(self, delSurface: int | ZOSAPI_Editors_LDE_ILDERow) None[source]#

Removes the surface at specified location in the LDE.

Parameters:

delSurface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The location to delete the surface. Specified by either an index or a surface object.

skZemax.skZemax_subfunctions._LDE_functions.LDE_RunRayTrace(self, ray_trace_rays: Dataset = None) Dataset[source]#

This funcion executes a sequential ray trace. There are differnt definitions for a seqeutnal ray trace:

  • Normalized Unpolarized (NormUnpol)

  • Direct Unpolarized (DirectUnpol)

  • Normalized Polarized (NormPol)

  • Direct Polarized (DirectPol)

The normalized/direct distinction consdiers

according to settings/values given in an xarray.

Parameters:

ray_trace_rays (xr.Dataset, optional) – Infromation of rays which should be traced, defaults to None (will use LDE_BuildRayTraceNormalizedUnpolarizedRays() as default)

skZemax.skZemax_subfunctions._LDE_functions.LDE_SetAllColumnDataOfSurfaceFromDict(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, SurfaceLDE_dict: dict) None[source]#

Sets all column data of a Sequential surface from a dict - usually the dict produced by LDE_GetAllColumnDataOfSurface() after being altered.

This was made to reflect the functions of NCE_GetAllColumnDataOfObject() and NCE_SetAllColumnDataOfObjectFromDict() which are for robustness in Non-sequential mode. However, unlike Non-sequential mode, Sequential mode seems to work as the API intended so you don’t need to use these lower level dict functions to adjust surface properties.

However, it is still very useful to set properties through this mechanism in python code.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • SurfaceLDE_dict (dict) – Column properties and values to set for the surface.

skZemax.skZemax_subfunctions._LDE_functions.LDE_SetSurfaceAsStop(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow) None[source]#

Sets the surface as the system stop.

Parameters:

in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

skZemax.skZemax_subfunctions._LDE_functions.LDE_SetTiltDecenterAfterSurfaceMode(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, mode: str | tuple[str, int]) ZOSAPI_Editors_LDE_ILDERow[source]#

This function is a compliment function to LDE_SetTiltDecenterOfSurface() and sets the “After surface mode”.

After the surface, the same set of operations may be performed in either order. The values for the before and after decenters and tilts, and the order in which they are done, may be independent. However, it is frequently useful to have the after tilts and decenter values be related to previous before values.

  • “explicit”

  • “pickup”

  • “reverse”

  • (‘pickup’, surface[int, ZOSAPI_Editors_LDE_ILDERow])

  • (‘reverse’, surface[int, ZOSAPI_Editors_LDE_ILDERow])

Reversing values from a prior surface involves changing the order and picking up the tilt and decenter values from the target surface and reversing the sign. The coordinate system resulting from the before and after tilt and decenters will define the coordinate system for the next surface. The thickness of a surface is the thickness in the new coordinate system after all the tilt and decenters are applied, measured along the resulting Z axis.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • mode (Union[str, tuple[str, Union[int, ZOSAPI_Editors_LDE_ILDERow]]]) – One of the modes listed above.

Returns:

The surface object

Return type:

ZOSAPI_Editors_LDE_ILDERow

skZemax.skZemax_subfunctions._LDE_functions.LDE_SetTiltDecenterOfSurface(self, in_Surface: int | ZOSAPI_Editors_LDE_ILDERow, BeforeSurfaceDecenterX: float = 0.0, BeforeSurfaceDecenterY=0.0, BeforeSurfaceTiltX: float = 0.0, BeforeSurfaceTiltY: float = 0.0, BeforeSurfaceTiltZ: float = 0.0, AfterSurfaceDecenterX: float = 0.0, AfterSurfaceDecenterY=0.0, AfterSurfaceTiltX: float = 0.0, AfterSurfaceTiltY: float = 0.0, AfterSurfaceTiltZ: float = 0.0, BeforeSurfaceOrder: str = 'Decenter_Tilt', AfterSurfaceOrder: str = 'Decenter_Tilt') ZOSAPI_Editors_LDE_ILDERow[source]#

Sets the tilt and decenter properties of a surface.

Surface tilts and decenters allow a change in the coordinate system to be implemented both before and after ray tracing to the surface. Surface tilts and decenters are redundant with and very similar to coordinate breaks. A surface tilt/decenter can be thought of as a coordinate break, followed by the surface, followed by another coordinate break.

The advantage to using surface tilts and decenters is the elimination of “dummy” coordinate break surfaces in the Lens Data Editor. This allows for a somewhat less cluttered display some users prefer. The disadvantage of using the surface tilts and decenters is the current implementation does not support optimization of surface tilt and decenter data.

Parameters:
  • in_Surface (Union[int, ZOSAPI_Editors_LDE_ILDERow]) – The surface to change as an object or as an index.

  • BeforeSurfaceDecenterX (float, optional) – Decenter in X before surface, defaults to 0.0

  • BeforeSurfaceDecenterY (float, optional) – Decenter in Y before surface, defaults to 0.0

  • BeforeSurfaceTiltX (float, optional) – Tilt in X before surface, defaults to 0.0

  • BeforeSurfaceTiltY (float, optional) – Tilt in Y before surface, defaults to 0.0

  • BeforeSurfaceTiltZ (float, optional) – Tilt in Z before surface, defaults to 0.0

  • AfterSurfaceDecenterX (float, optional) – Decenter in X after surface, defaults to 0.0

  • AfterSurfaceDecenterY (float, optional) – Decenter in Y after surface, defaults to 0.0

  • AfterSurfaceTiltX (float, optional) – Tilt in X after surface, defaults to 0.0

  • AfterSurfaceTiltY (float, optional) – Tilt in Y after surface, defaults to 0.0

  • AfterSurfaceTiltZ (float, optional) – Tilt in Z after surface, defaults to 0.0

  • BeforeSurfaceOrder (str, optional) – Before surface order of decenters and tilts, defaults to ‘Decenter_Tilt’

  • AfterSurfaceOrder (str, optional) – After surface order of decenters and tilts, defaults to ‘Decenter_Tilt’

Returns:

The object of the surface.

Return type:

ZOSAPI_Editors_LDE_ILDERow