Optionalopts: CaptureOptionsRead the current camera as a serializable snapshot (#268), or null before the renderer is ready / on the 2D renderer (which has no 3D pose).
Render diagnostics snapshot (DD-027, DD-031 G1) — backend, WebGL version, GPU (hardware/software),
geometry mode, build parallelism + worker count, draw calls, tube-byte budget, and parse/build/
first-frame timings — or null before the first render and on the 2D renderer (which produces none).
Reachable through the public surface so a diagnostics panel needs no raw.renderer().
Capability gate for a color mode against the current file (DD-031 G6) — mirrors
GcodePreviewState.availableColorModes for a one-off query. false when the file lacks the
channel the mode reads; always true before a parse (optimistic, like setColorMode).
Pick the IR segment under a pointer in normalized device coords ([-1, 1], y up), or null (DD-031 G2,
#184). Powers source-mapping/inspection UI. The 3D renderer raycasts the toolpath; the 2D renderer
returns null (no picking yet). threshold widens the hit test (world units).
Optionalthreshold: numberMarks the volume consumer-configured: file-discovered geometry stops auto-applying.
Show/hide the build-volume wireframe cage independently of the bed/plate (#306/#6).
Change the perspective lens (DD-032 §4.2), degrees. The camera dollies to keep the framing, without
a re-fit and without a camera-changed event; while orthographic the lens is remembered and
applied on the switch back. Throws RangeError synchronously outside [10, 120] (never clamped),
even before the 3D renderer has loaded. Kept across canvas rebinds. The 2D renderer discloses
this via renderer-unsupported.
Restore a camera snapshot verbatim (#268) — no re-fit to the current model. 2D discloses.
Show/hide a single feature role — e.g. hide Skirt/Brim to declutter a part preview. Gate the
UI on capabilities.featureRoles === 'known' (like the feature color mode); a no-op on the 2D
renderer and on files without feature annotations. Import FeatureRole from @chestnutlabs/toolpath-core.
Frame the printed 'object' (excl. skirt/prime) vs 'all' extrusion, and re-frame (#306/#6).
Interaction-aware quality: 'auto' reduces detail while the camera moves (#306/2, DD-020).
Change the resting pixel ratio: a number in (0, 4], or 'device' (DPR capped at 2, followed live).
A gesture in progress keeps its interaction-quality reduction and settles on the new ratio. Throws
RangeError synchronously otherwise (never clamped), even before the 3D renderer has loaded. Kept
across canvas rebinds. The default capture() size does not change; pass width/height for a
crisper image. The 2D renderer discloses this via renderer-unsupported.
Set the during-parse preview curtain (#60): 'lines' | 'hold' | 'off'. Applies to the next parse. 3D only.
Set the fidelity policy (DD-023 §4 D6): 'full' | 'adaptive' | 'fast'. 3D only.
Time-based scrub (#181): cut the toolpath at print time ms (kinematic axis). null clears the
cut. Resolves to a segment-index scrub; no-op before a successful parse.
Opt-in retraction/deretraction markers (DD-009 D1, #148). Off by default.
Snap to a preset orientation — top/front/iso/… (#268). Instant; preserves the projection.
The 2D renderer discloses this via renderer-unsupported rather than moving.
Capture the currently displayed view as an image
Blob(DD-030 D1) — for a user-selected thumbnail, a large-file fallback, or a screenshot. Rejects withE_CAPTURE_UNSUPPORTEDbefore the 3D renderer is ready or on the 2D renderer (which cannot render-to-target). The caller owns theBlob.