Create Display.
the DOM element that should contain the Display
display options
Add the Cad tree and other UI elements like Clipping
the DOM element that contains the cadTree
Add HTML content to the info panel.
The HTML string to add.
Handler for the animation slider
Auto collapse tree nodes when cad width < 600
Capture the canvas as a data URL.
Capture options.
Promise resolving to task ID and data URL.
Check or uncheck a checkbox
name of the check box, see getElement
whether to check or uncheck
Clear the Cad tree
Outer-cycle boundary: discard saved Material Editor deltas so they don't replay on the next Studio entry in a new scene. Unlike viewer preferences (transparent, axes, grid) which persist across render cycles, Material Editor edits are per-scene PBR authoring and must reset on scene rebuild. Mid-cycle (Studio tab leave/enter) and inner-cycle (editor close/reopen) behavior is unaffected — this is only called from viewer.clear().
Handler for the animation control buttons
Handle animation control by button name
Dispose of all resources. Call when done with the viewer.
Disposes:
After dispose(), the Display instance should not be used.
Dispose all cloned materials, restoring originals first (call on Studio mode exit)
Get the DOM canvas element
Enable/disable glass mode (UI update only).
Reset clip planes to default normals and slider positions
Collapse nodes handler (event handler) Translates button codes to CollapseState and calls viewer
Reset material values to original values
Handler for Studio 4K env maps checkbox change. Shows a "Loading…" indicator while the new resolution downloads.
Handler for Studio AO intensity slider change. Slider range 0-30, divided by 10 → state gets 0-3.0. A value of 0 disables AO.
Handler for Studio background dropdown change. Validates against the StudioBackground union before setting state.
Handler for Studio env intensity slider change. Slider range 0-200 with percentage=true, so value arrives as 0-2.
Handler for Studio environment dropdown change
Reset Studio tab values to defaults. Delegates to viewer.resetStudio() (same pattern as handleMaterialReset -> resetMaterial()).
Handler for Studio exposure slider change. Slider range 0-200 with percentage=true, so value arrives as 0-2.
Handler for Studio tone mapping dropdown change. Validates against the StudioToneMapping union before setting state.
Reset zebra tool to default settings
Called by viewer.ts when the selected object changes. Updates or closes the material editor if it's open.
Pin screenshot of canvas as PNG
Refresh clipping plane position
Replace container content with a static image
Handler to reset position, zoom and up of the camera
Handler to reset zoom of the camera
Handler to activate a UI tab (tree / clipping / material / zebra)
Checkbox Handler for setting the axes parameter
Checkbox Handler for setting the axes0 parameter
Checkbox Handler for setting the black edges parameter
Checkbox Handler for setting the clip intersection parameter
Set the normal at index to the current viewing direction
Checkbox Handler for setting the clip planes parameter
Handler for the explode button
Checkbox Handler for setting the grid parameter
Handler to set the label of a clipping normal widget
Checkbox Handler for toggling the clip caps
Checkbox Handler for setting the ortho parameter
Set the width and height of the different UI elements (tree, canvas and info box).
Size options
Set minimum and maximum of the clipping sliders
Set the UI theme.
"light", "dark", or "browser" for auto-detection
The resolved theme ("light" or "dark")
Checkbox Handler for setting the tools mode. Delegates state mutations to Viewer.activateTool() to maintain unidirectional data flow.
Checkbox Handler for setting the transparent parameter
InternalSet up the UI and attach the canvas element. Called by Viewer constructor, not intended for direct use.
The viewer instance for this UI.
The Three.js renderer canvas to attach.
Handler to set camera to a predefined position. Called by Button callback which passes the button name as string.
Handler for setting the zebra color scheme
Set zebra color scheme radio button in the UI
Set zebra stripe count in the UI
Set zebra stripe direction in the UI
Handler for setting the zebra mapping mode
Set zebra mapping mode radio button in the UI
Set zebra stripe opacity in the UI
Checkbox Handler for setting the zscale mode
Display bounding box information for a selected object.
The object's path in the tree.
The object's name.
The bounding box to display.
Display camera target center information.
The center coordinates [x, y, z].
Show or hide the distance measurement panel
Show or hide the Explode checkbox
Show or hides explode tool
Show or hide help dialog
Show or hide info dialog
Show or hides measurement tools, measurement tools needs a backend to be used.
Show/hide pinning button
Show or hide the properties measurement panel
Display the ready message with viewer version and control mode.
Viewer version string.
Control mode name (e.g., "orbit", "trackball").
Show or hides select tool
Show or hide the CAD tools (UI update only). This method only updates the visual state - it does not modify ViewerState.
Show or hide tools panel (tabs + content) in glass mode. Also toggles the orientation marker and animation/explode slider.
Show or hide the ZScale slider
Show or hides ZScale tool
Sync clip slider UI from current state values. Called after setSliderLimits to apply initial values with correct limits.
Sync material slider UI from current state values. Called from updateUI after render options are applied to state. State stores values in 0-1 range, sliders display 0-100 (or 0-400 for lights).
Sync Studio slider/control UI from current state values.
Sync zebra slider UI from current state values. Called from updateUI after viewer options are applied to state.
Toggle visibility of the clipping tab
Toggle help dialog visibility
Toggle info dialog visibility
Toggle tools panel visibility
Update help dialog with new key mappings
Update toolbar collapse state based on available width. Maximizes toolbar if width is sufficient, minimizes otherwise.
The available width in pixels.
Update tooltips with keyboard shortcut suffixes.
InternalInitialize UI elements from current state. Called once during initialization. Subsequent updates happen via state subscriptions.
Main entry point for three-cad-viewer. Creates the UI and manages the viewer.
Display handles:
Usage
Options
See
DisplayOptions for all configuration options