Creates a new WebGLPreview instance
Configuration options
Optional
_Last layer to render (1-based index)
Last render time in milliseconds
Whether single layer mode is enabled
Optional
_First layer to render (1-based index)
Whether to render in wireframe mode
Three.js perspective camera
Canvas element being rendered to
Orbit controls for camera
Disable color gradient between layers
Optional
extrusionWidth of extruded material
Whether to use inches instead of millimeters
Initial camera position [x, y, z]
G-code interpreter
Job containing parsed G-code data
Height of extruded lines
Optional
lineWidth of rendered lines
Minimum layer height threshold
List of G-code commands considered non-travel moves
G-code parser
Three.js WebGL renderer
Whether to render extrusion paths
Whether to render travel moves
Whether to render paths as 3D tubes
Three.js scene
Static
Readonly
defaultDefault extrusion color
Gets the current background color
Current background color
Sets the background color
Color value as number, string, or Color instance
Gets the current bounding box color
Color representation or undefined if not set
Sets the bounding box color
Color value or undefined to hide the bounding box
Sets the build volume dimensions
Partial build volume properties (x, y, z, smallGrid)
Gets the total number of layers in the job
Number of layers
Gets the current end layer (1-based index)
End layer number
Sets the end layer (1-based index)
Layer number to end rendering at
Gets the current extrusion color(s)
Color or array of colors for extruded paths
Sets the extrusion color(s)
Color value(s) as number, string, Color instance, or array of ColorRepresentation
Gets the current last segment color
Color representation or undefined if not set
Sets the last segment color
Color value or undefined to clear
Gets whether single layer mode is enabled
True if single layer mode is active
Sets single layer mode
True to enable single layer mode
Gets the current start layer (1-based index)
Start layer number
Sets the start layer (1-based index)
Layer number to start rendering from
Gets the current top layer color
Color representation or undefined if not set
Sets the top layer color
Color value or undefined to clear
Gets the current travel move color
Current travel move color
Sets the travel move color
Color value as number, string, or Color instance
Processes G-code and updates the visualization
G-code string or array of strings to process
Options for rendering: { render: boolean }
Renders all visible paths in the scene
Experimental
Renders paths incrementally using an animation loop
Number of paths to render per frame
Promise that resolves when rendering is complete
WebGL-based G-code preview renderer