optimization.variable.element#
Element Variable Module
This module contains variables that move a group of consecutive surfaces (an element, or a group of elements) as one rigid body: a decenter, a tilt about a pivot point, and a roll about the element axis. Surfaces after the element do not move.
The axes are those of the element: the local x, y and z axes of its first surface. For an element on the optical axis these are the global axes.
Kramer Harrison, 2026
Classes
|
Decenter of an element along its local |
|
Roll of an element about its local z axis through the pivot, in radians. |
|
Tilt of an element about its local |
|
Variable that moves a group of surfaces as one rigid body. |
|
A group of consecutive surfaces moved as one rigid body. |
- class ElementDecenterVariable(optic, first, last, axis, scaler=None, **kwargs)[source]#
Decenter of an element along its local
axis(“x” or “y”), in lens units.- Parameters:
optic – The optic that holds the surfaces.
first – The first surface of the element.
last – The last surface of the element (inclusive).
axis –
"x"or"y".scaler – The scaler for the variable. Defaults to IdentityScaler().
**kwargs – Additional keyword arguments.
- get_value()#
Return the current move of the element.
- inverse_scale(scaled_value)#
Inverse scale the value of the variable.
- Parameters:
scaled_value – The scaled value to inverse scale
- scale(value)#
Scale the value of the variable for improved optimization performance.
- Parameters:
value – The value to scale
- class ElementRollVariable(optic: Optic, first: int, last: int, scaler: Scaler = None, pivot: str | float = 'center', **kwargs)[source]#
Roll of an element about its local z axis through the pivot, in radians.
- Parameters:
optic – The optic that holds the surfaces.
first – The first surface of the element.
last – The last surface of the element (inclusive).
scaler – The scaler for the variable. Defaults to IdentityScaler().
pivot – The pivot point; see
RigidElement. Defaults to"center".**kwargs – Additional keyword arguments.
- get_value()#
Return the current move of the element.
- inverse_scale(scaled_value)#
Inverse scale the value of the variable.
- Parameters:
scaled_value – The scaled value to inverse scale
- scale(value)#
Scale the value of the variable for improved optimization performance.
- Parameters:
value – The value to scale
- class ElementTiltVariable(optic, first, last, axis, scaler=None, **kwargs)[source]#
Tilt of an element about its local
axis(“x” or “y”) through the pivot, in radians.- Parameters:
optic – The optic that holds the surfaces.
first – The first surface of the element.
last – The last surface of the element (inclusive).
axis –
"x"or"y".scaler – The scaler for the variable. Defaults to IdentityScaler().
pivot – The pivot point; see
RigidElement. Defaults to"center".**kwargs – Additional keyword arguments.
- get_value()#
Return the current move of the element.
- inverse_scale(scaled_value)#
Inverse scale the value of the variable.
- Parameters:
scaled_value – The scaled value to inverse scale
- scale(value)#
Scale the value of the variable for improved optimization performance.
- Parameters:
value – The value to scale
- class ElementVariableBehavior(optic: Optic, first: int, last: int, scaler: Scaler = None, pivot: str | float = 'center', **kwargs)[source]#
Variable that moves a group of surfaces as one rigid body.
The value is the move from the state the variable was created in: zero at first. Each update applies the change from the previous value to the current surface positions, so other variables that act on the same surfaces (a thickness, for example) keep their effect.
- Parameters:
optic – The optic that holds the surfaces.
first – The first surface of the element.
last – The last surface of the element (inclusive).
scaler – The scaler for the variable. Defaults to IdentityScaler().
pivot – The pivot of tilts and rolls; see
RigidElement.**kwargs – Additional keyword arguments.
- inverse_scale(scaled_value)#
Inverse scale the value of the variable.
- Parameters:
scaled_value – The scaled value to inverse scale
- scale(value)#
Scale the value of the variable for improved optimization performance.
- Parameters:
value – The value to scale
- class RigidElement(optic: Optic, first: int, last: int, pivot: str | float = 'center')[source]#
A group of consecutive surfaces moved as one rigid body.
- Parameters:
optic – The optic that holds the surfaces.
first – The first surface of the element.
last – The last surface of the element (inclusive).
pivot – The point that tilts and rolls are about:
"center"(default, midway between the first and last vertex),"first"or"last"(that vertex), or a number: the distance from the first vertex along the element axis, in lens units.
- Raises:
ValueError – If the surface range or the pivot is invalid, or if a surface is placed relative to another coordinate system.
- axis(name: str) Vector[source]#
Return the element’s local
"x","y"or"z"axis in global coordinates.
- decenter(axis: str, distance) None[source]#
Move the element along its local
axis(“x” or “y”).- Parameters:
axis – The element axis to move along.
distance – The distance, in lens units.
- move(kind: str, axis: str, amount) None[source]#
Apply a decenter (
kind="decenter") or a rotation (kind="tilt"or"roll") ofamount.