メインコンテンツ

addGap

Add gap between optical components

Since R2026a

Description

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

addGap(opsys,gap) adds a gap between the last component of the optical system opsys and the component to be inserted next. Use this function to add a gap after a component added using the add function.

example

addGap(opsys,gap,ReferenceFrame=frame) specifies the reference frame in which to position the gap as the global or construction coordinate system.

Examples

collapse all

Create an empty optical system.

opsys = opticalSystem;

To add a lens component to the optical system, create the two refractive surfaces of the lens using the addRefractiveSurface object function. Specify the lens glass material using the Material name-value argument for the first surface. Specify the center thickness of the lens, in millimeters, using the DistanceToNext name-value argument for the first surface.

addRefractiveSurface(opsys,Radius=10,DistanceToNext=4,Material=pickGlass("N-BK7"))
addRefractiveSurface(opsys,Radius=-10)

Add a gap of 3.5 millimeters between the end of the convex lens and the next component using the addGap object function.

addGap(opsys,3.5)

Add an image plane using the addImagePlane object function.

addImagePlane(opsys)

Display a 2-D visualization of the initial optical system by using the view2d object function.

hv = view2d(opsys);

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 to which to add the gap, specified as an opticalSystem object.

Gap between the current state of the optical system and the next component to be inserted, specified as a positive scalar. Units are in millimeters.

Reference frame, specified as "ConstructionFrame" or "Global".

ReferenceFrame ValueReference Frame For Optical Component
"Global"

Position the gap in the global coordinate system.

"ConstructionFrame"

Position the optical component in the construction coordinate system. By default, the construction coordinate system origin is a central point on the previous component in the optical system, such as the end vertex of a lens.

To learn more about working with optical coordinate systems, see Coordinate Systems in Optical Design.

Version History

Introduced in R2026a