メインコンテンツ

explode

Explode components in 3-D optical system visualization radially outward

Since R2026a

    Description

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

    explode(osv) explodes each component in the optical system visualization osv radially outward to enable you to better visualize the internal structure of the optical system.

    example

    explode(osv,Name=Value) specifies properties for the explosion by using one or more optional name-value arguments. For example, ComponentTypes="Mirror" explodes only the mirror components in the optical system radially outward.

    Examples

    collapse all

    Create a simple optical system.

    opsys = opticalSystem;
    addRefractiveSurface(opsys,Radius=9,Material=[1.74 25.4],DistanceToNext=3) 
    addRefractiveSurface(opsys,Radius=-9,DistanceToNext=10)
    addImagePlane(opsys)

    Visualize the optical system in 3-D.

    osv3d = view3d(opsys,Title="Convex Lens")

    osv3d = 
      OpticalSystemViewer3D with properties:
    
                  Title: [0×0 string]
                 Labels: "none"
              ClipAngle: 0
                   Rays: [0×0 optics.ui.Rays3D]
        BackgroundColor: [0.9608 0.9608 0.9608]
          GradientColor: [0.9020 0.9020 0.9020]
                 Parent: [1×1 Figure]
    
      Show all properties
    
    

    Trace rays in the optical system to add to the visualization. Observe that rays contains three ray bundles.

    rays = traceRays(opsys)
    rays=1×3 RayBundle array with properties:
        1×1 RayBundle    1×1 RayBundle    1×1 RayBundle
    
    

    You can add only one ray bundle to a 3-D visualization. Add one of the ray bundles from the traced rays to the visualization.

    addRays(osv3d,rays(1))

    Explode the visualization. The explosion moves each component in the optical system visualization radially outward to enable you to better visualize the internal structure of the optical system.

    explode(osv3d)

    Restore the visualization to its state before the explosion.

    unexplode(osv3d)

    Show only the lens element, which is the first optical component, in the visualization.

    showComponents(osv3d,1)

    Remove the rays from the visualization.

    removeRays(osv3d)

    Add component labels to the visualization.

    osv3d.Labels = "component";

    Input Arguments

    collapse all

    Optical system visualization to customize, specified as an OpticalSystemViewer3D object.

    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: explode(osv,ComponentTypes="Mirror") explodes only the mirror components in the optical system radially outward.

    Scale of the explosion, specified as a positive scalar. The scale indicates the factor of the largest radius of all components, which the function uses to control the radial distance that each component moves.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Number of radial arms in the explosion, specified as a positive integer.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Number of steps in the radial direction, specified as a positive integer.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Types of components to explode, specified as one or more of these options.

    • "LensElement"

    • "Mirror"

    • "ObjectPlane"

    • "ImagePlane"

    • "Diaphragm"

    • "All"

    To explode a component, its type must be part of ComponentTypes and its index must be listed in ComponentIndex.

    Data Types: char | string

    Index of components to explode, specified as a vector of positive integers. By default, the function explodes all the components in the system. To explode a component, its type must be part of ComponentTypes and its index must be listed in ComponentIndex.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Version History

    Introduced in R2026a