主要内容

setConstructionFrame

Set coordinate break for all subsequent components in optical system

Since R2026a

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

setConstructionFrame(opsys,Name=Value) specifies a coordinate break for all the subsequent components in the optical system using one or more name-value arguments. For example, TiltAngle=[10 10 0] specifies a tilt angle of [10 10 0] for all the subsequent components in the optical system.

example

Examples

collapse all

Create an empty optical system, and specify the light wavelength as the Fraunhofer F line.

opsys = opticalSystem(Wavelengths=optics.constant.Fraunhofer.F);

Display the value of the ConstructionFrame property of the optical system opsys.

opsys.ConstructionFrame
ans = 4×4

     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1

To add a lens component to the optical system, create the first refractive surfaces of the lens. Specify a positive radius of curvature using the Radius name-value argument, the thickness of the lens using the DistanceToNext name-value argument, and the glass material type using the Material name-value argument.

addRefractiveSurface(opsys,Radius=15,DistanceToNext=2,Material="N-BK7")

Create the second refractive surface of the lens. To create a convex lens, specify a negative radius of curvature for the second surface using the Radius name-value argument.

addRefractiveSurface(opsys,Radius=-15);

Display the updated value of the ConstructionFrame property of opsys.

opsys.ConstructionFrame
ans = 4×4

     1     0     0     0
     0     1     0     0
     0     0     1     2
     0     0     0     1

Set the coordinate system for the next component. Specify the position of the new construction optical axis as [0 1 5], and tilt the new construction axis by 10 degrees relative to the global x-axis. This configures the optical system to position the next components you add along the specified tilt angle, starting at the point [0 1 5].

setConstructionFrame(opsys,Position=[0 1 5],TiltAngles=10)

Display the updated value of the ConstructionFrame property of opsys.

opsys.ConstructionFrame
ans = 4×4

    1.0000         0         0         0
         0    0.9848   -0.1736    1.0000
         0    0.1736    0.9848    5.0000
         0         0         0    1.0000

Add a second lens component to the optical system, by adding the two refractive surfaces of the lens to the optical system.

addRefractiveSurface(opsys,SemiDiameter=2,Radius=10,DistanceToNext=1.5,Material=pickGlass("N-BK7"))
addRefractiveSurface(opsys,SemiDiameter=2,Radius=-10)

Add a gap and add an image plane.

addGap(opsys,10)
addImagePlane(opsys,SemiDiameter=1)

Trace rays through the optical system using the traceRays object function.

rays = traceRays(opsys,SamplingSurface="first-surface");

Display a 2-D visualization of the optical system using the view2d function. Visualize the ray path using the addRays object function.

hv = view2d(opsys);
addRays(hv,rays)

Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title Optical System.

Input Arguments

collapse all

Optical system in which to change the construction coordinate system, specified as an opticalSystem object. The optical system applies your specified changes to the construction frame when you add the next component to the system.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: setConstructionFrame(TiltAngle=[10 10 0]) specifies a tilt angle of [10 10 0] for the subsequent components in the optical system.

Origin of construction frame for the next components with respect to the global reference frame, specified as one of these options.

  • 3-element row vector of the form [Tx, Ty, Tz] — Tx, Ty, and Tz are the global x-, y-, and z-coordinates of the origin of the construction axis for the next component, respectively.

  • Numeric scalar — Updates only the global z-coordinate of the origin of the construction frame for the next component.

By default, the origin of the construction frame is represented by the ConstructionFrame property of the opticalSystem object opsys.

Tilt angles of the next components to be added to the optical system, specified as one of these options.

  • 3-element row vector of the form [θx θy θz] — θx, θy, and θz are tilt angles with respect to the global x, y, and z-axes.

  • Numeric scalar — Rotates the construction axis by this angle, in degrees, relative to the global x-axis.

By default, the origin of the construction axis is represented by the ConstructionFrame property of the opticalSystem object opsys.

Note

The TiltAngles property represents Euler angles. If you specify angles that are multiples of 90 degrees, visually verify the orientation of the optical system. Gimbal lock can occur, in which two of the three rotational axes become aligned. This alignment results in the loss of one degree of freedom, and can lead to ambiguous or unintended orientations.

Version History

Introduced in R2026a