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
Kinematic
A ObjectGroup implements the kinematic functions of AbstractObject. 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::ObjectGroup, 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 center