OptionalextrusionWidth: numberOptionalonRebuildNeeded: RebuildRequestOptionalboundingOptionalboundingWireframe box around the model, created lazily on first draw
OptionalbuildBuild volume visualization, or undefined when none is drawn
Clipping planes for the current layer range, applied to every line material we create
Current extrusion color(s); an array is indexed by tool
OptionalextrusionWidth of extruded material. Undefined means each path uses its own width.
Whether extrusion lines get a per-layer brightness gradient baked into their vertex colors. Only meaningful for line rendering; tubes ignore it.
Total number of layers, used to normalize the gradient ramp
Shader materials used for tube rendering, indexed by tool
Current travel move color
Static ReadonlydefaultDefault color for extrusions when the caller supplies none
Static ReadonlyrebuildHow long to coalesce geometry rebuilds for, in ms
Records paths as rendered without drawing them, so later batches skip them.
Used when a highlight redraws part of a path — its final segment in its own color — so the per-tool batch does not also draw the original whole path. The claim is part of the current highlight and is undone by revertHighlight.
Resolves the color a tool draws with, falling back when the array has no entry.
Tool asking for its color
Renders a tool's extrusions in whichever representation is currently selected, in the color the tool resolves to.
Draws paths in a single color with a dedicated material, independent of
the per-tool colors, and records them as rendered.
Used for highlight overlays — the top layer and the last segment — that must win over the tool color. Because the material is not the cached per-tool one, recoloring a tool later leaves the highlight untouched. The object is tagged so setExtrusionColor skips it for the same reason.
Draws a slice of the job's combined path list, routing each path to its category: travels as travel lines, extrusions per tool in the current representation.
Paths in print order, travels and extrusions interleaved
Which categories to draw. Paths of a disabled category are left unrendered, so they draw when the category is re-enabled.
Removes the currently drawn highlight and forgets that its paths were rendered, so the next render call redraws them in their normal color.
Used to move a live top-layer/last-segment highlight forward as newer layers or segments arrive, without leaving stale highlighted geometry behind on the layer or path it has moved past. Only what the highlight itself drew or claimed is unclaimed — paths the per-tool batches drew stay rendered, so they are not drawn a second time. The overlay's own geometry and material are disposed; the per-path source geometries they were built from are left for the next full reset — the paths get redrawn through the normal path, which builds its own fresh geometry anyway.
Recolors the bounding box in place; undefined hides it.
Optionalcolor: ColorNew color, or undefined to hide the box
Replaces the build volume visualization, or removes it when no dimensions are given.
Optionalvalue: BuildVolumeDefBuild volume dimensions, or undefined to draw none
Stores the extrusion color(s) and repaints the rendered extrusions in place.
One color for every tool, or an array indexed by tool
Draws the bounding box for the given bounds, creating or resizing the mesh as needed.
OptionalminZ: numberOptionalmaxZ: number
Color of the bounding box; undefined hides it