主要内容

unexplode

Restore original component locations in 3-D optical system visualization after explosion

Since R2026a

    Description

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

    unexplode(osv) restores the original locations of the components in the optical system visualization osv after you explode the visualization using the explode function.

    example

    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.

    Version History

    Introduced in R2026a