Skip to content

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.

julia
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 position

Objects 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

A 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 group

  • dir: a 3x3 matrix that describes the common orientation of the group

  • objects: stores AbstractObject, can also store subgroups of type AbstractObjectGroup

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 vector

  • translate_to3d!: all objects are moved in parallel such that the group center is equal to the target position

  • rotate3d!: all objects are rotated around the center point with respect to their relative position

  • set_pivot3d!: moves the group center (the pivot used above) without moving any of its objects

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.

source
BeamletOptics.set_pivot3d! Method
julia
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:

julia
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
source