Moving optical elements
Optical elements that implement the BeamletOptics.AbstractObject interface, as well as the BeamletOptics.AbstractShapes they are built from, can be moved with the commands listed in the Kinematics section. When objects are manipulated, they are translated and rotated around their self-defined center of gravity, i.e. their position. Their orientation defines their local fixed coordinate system.
using BeamletOptics
mirror = RoundPlanoMirror(25.4e-3, 5e-3)
translate3d!(mirror, [0, 0.1, 0]) # move 10 cm along the global y-axis
zrotate3d!(mirror, deg2rad(45)) # rotate 45° about z through the mirror positionObjects with multiple shapes
Objects which consist of more than one shape, e.g. a CubeBeamsplitter or a doublet lens, move all of their shapes as one rigid body. Unless the object defines its own reference point, the position and orientation of its first shape are used as the kinematic center, see BeamletOptics.MultiShape.
Groups of optical elements
For the easier representation of a group of BeamletOptics.AbstractObjects that moves as one, the ObjectGroup can be used. Refer to the Lens groups example for more information. The group's pivot (its center) can be moved without moving its members via set_pivot3d!.
BeamletOptics.ObjectGroup Type
ObjectGroup <: AbstractObjectGroupA tree-like storage container for groups of objects. Can store individual objects and subgroups. Main purpose is handling of, i.e., groups of lenses.
Fields
center: a point in 3D space which is regarded as the reference origin of the groupdir: a 3x3 matrix that describes the commonorientationof the groupobjects: storesAbstractObject, can also store subgroups of typeAbstractObjectGroup
Each of its objects is traced and interacts on its own, read them via objects(group).
Kinematic
An ObjectGroup implements the kinematic API, see BeamletOptics.AbstractKinematicTrait. The following logic is applied to
translate3d!: all objects in the group are translated by the offset vectortranslate_to3d!: all objects are moved in parallel such that the groupcenteris equal to the target positionrotate3d!: all objects are rotated around thecenterpoint with respect to their relative positionset_pivot3d!: moves the groupcenter(the pivot used above) without moving any of itsobjects
The objects must be either all static or all movable, otherwise the constructor throws an ArgumentError. The group takes that kinematic class, see BeamletOptics.AbstractKinematicTrait.
BeamletOptics.set_pivot3d! Method
set_pivot3d!(group::AbstractObjectGroup, pivot)Moves the kinematic pivot (center) of group to pivot, without moving any of its objects. The pivot is the reference point used by rotate3d!, translate_to3d! and reset_translation3d!; the group orientation is unchanged.
Example
Rotate a lens group about its first surface instead of the group's default center:
group = ObjectGroup([lens1, lens2])
set_pivot3d!(group, position(lens1))
rotate3d!(group, [0, 0, 1], deg2rad(5)) # rotates about lens1's position, not the old centerAssemblies: group or multi-shape object
An assembly such as a telescope, a periscope or an interferometer arm can be modeled in two ways, and the choice follows from whether its parts touch:
| Parts of the assembly | Model | interact3d |
|---|---|---|
| separate, with air between them | an ObjectGroup or an own subtype of BeamletOptics.AbstractObjectGroup | none: each part is traced and interacts on its own |
| touching and interacting as one, e.g. cemented or with a shared face | an BeamletOptics.AbstractObject with the BeamletOptics.MultiShape trait, like the CubeBeamsplitter | required: the solver hands every hit to the object, which forwards it to the part that was hit |
The solver can find out by itself which of several separate parts a ray hits next. Parts that touch need a BeamletOptics.Hint across their shared face, which only the component knows. An own subtype of AbstractObjectGroup adds named parts and an own constructor to a group and needs no interact3d method; its fields and its constructor check are listed in the docstring of BeamletOptics.AbstractObjectGroup, and the agent skill has a complete example in templates/08_custom_group.jl. A MultiShape object without an interact3d method stops every ray that hits it, with the warning No interact3d method defined for the MultiShape object.