@chestnutlabs/gcode-preview-core 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controller.d.ts +15 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/controller.js +18 -1
- package/dist/render-still.d.ts +21 -1
- package/dist/render-still.d.ts.map +1 -1
- package/dist/render-still.js +25 -2
- package/dist/renderer-2d-adapter.d.ts +2 -1
- package/dist/renderer-2d-adapter.d.ts.map +1 -1
- package/dist/renderer-2d-adapter.js +4 -0
- package/dist/renderer-interface.d.ts +6 -1
- package/dist/renderer-interface.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/controller.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* only (numbers/strings): IR/typed arrays NEVER enter the state model.
|
|
11
11
|
*/
|
|
12
12
|
import { GcodeParseSession, type ParseProgress, type ParseResult, type SessionOptions, type WireParseOptions } from '@chestnutlabs/gcode-parser';
|
|
13
|
-
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, GLRendererLike, ProgressPresentationMode, QualityMode, QualityPolicy, RenderTargetCanvas, Theme, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
13
|
+
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, GLRendererLike, ProgressPresentationMode, ProgressivePreview, QualityMode, QualityPolicy, RenderTargetCanvas, Theme, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
14
14
|
import type { MoveKindToggle, PreviewRenderer, PreviewRendererEvent, RendererMode } from './renderer-interface.js';
|
|
15
15
|
import { type Confidence, type DialectMetadata, type MachineGeometry, type MappedProgress, type ProgressObservation, type Warning } from '@chestnutlabs/toolpath-core';
|
|
16
16
|
/** Session/renderer events, re-emitted, plus the controller's own lifecycle events. */
|
|
@@ -66,6 +66,13 @@ export interface PreviewControllerOptions {
|
|
|
66
66
|
* the geometry `quality` tier. 3D only.
|
|
67
67
|
*/
|
|
68
68
|
qualityMode?: QualityPolicy;
|
|
69
|
+
/**
|
|
70
|
+
* During-parse preview presentation (#60 curtain): 'lines' (default, stream the progressive line
|
|
71
|
+
* preview), 'hold' (keep progress events but reveal only the final coloured build — a single clean
|
|
72
|
+
* reveal), or 'off' (no progressive geometry or preview progress; drive your own loading treatment).
|
|
73
|
+
* `parse-progress` events flow in every mode. 3D only.
|
|
74
|
+
*/
|
|
75
|
+
progressivePreview?: ProgressivePreview;
|
|
69
76
|
/** Camera projection (#150, DD-009 D3); default 'perspective'. 3D only. */
|
|
70
77
|
cameraMode?: CameraMode;
|
|
71
78
|
/** Framing target (#306/#6): 'all' extrusion (default) or the printed 'object'. 3D only. */
|
|
@@ -80,6 +87,11 @@ export interface PreviewControllerOptions {
|
|
|
80
87
|
adjacentLayers?: number;
|
|
81
88
|
/** 2D only: ghost-layer opacity (default 0.25). */
|
|
82
89
|
ghostOpacity?: number;
|
|
90
|
+
/** Parallel tube-geometry build (DD-028). Default `'auto'` (engages a capability+memory-aware pool
|
|
91
|
+
* for large tube builds in a browser); `'off'` forces the synchronous path. 3D only. */
|
|
92
|
+
geometryConcurrency?: 'auto' | 'off' | number;
|
|
93
|
+
/** Max in-flight tube-geometry bytes for the parallel build (DD-028 memory backpressure). 3D only. */
|
|
94
|
+
geometryMemoryBudgetBytes?: number;
|
|
83
95
|
/** Advanced/test injectables — pass-throughs of the renderer's own contract (3D only). */
|
|
84
96
|
createRenderer?: (canvas: RenderTargetCanvas) => GLRendererLike;
|
|
85
97
|
scheduleFrame?: (cb: () => void) => void;
|
|
@@ -149,6 +161,8 @@ export interface GcodePreviewControls {
|
|
|
149
161
|
setQuality(quality: QualityMode | 'auto'): void;
|
|
150
162
|
/** Set the fidelity policy (DD-023 §4 D6): 'full' | 'adaptive' | 'fast'. 3D only. */
|
|
151
163
|
setQualityMode(mode: QualityPolicy): void;
|
|
164
|
+
/** Set the during-parse preview curtain (#60): 'lines' | 'hold' | 'off'. Applies to the next parse. 3D only. */
|
|
165
|
+
setProgressivePreview(mode: ProgressivePreview): void;
|
|
152
166
|
/** Switch camera projection (#150, DD-009 D3). */
|
|
153
167
|
setCameraMode(mode: CameraMode): void;
|
|
154
168
|
/** Snap to a preset orientation — top/front/iso/… (#268). Instant; preserves the projection.
|
package/dist/controller.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,iBAAiB,EAGjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,KAAK,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EAGxB,KAAK,OAAO,EACb,MAAM,6BAA6B,CAAC;AAGrC,uFAAuF;AACvF,MAAM,MAAM,YAAY,GACpB,oBAAoB,GACpB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GACnD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,sGAAsG;IACtG,YA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AI,CAAC;IAC9C,gGAAgG;IAChG,qBAAqB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IAClD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9F,MAAM,IAAI,IAAI,CAAC;IACf,yFAAyF;IACzF,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;IACjE,wFAAwF;IACxF,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACnD,aAAa,IAAI,IAAI,CAAC;IACtB,iFAAiF;IACjF,QAAQ,IAAI,iBAAiB,CAAC;IAC9B,oEAAoE;IACpE,aAAa,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAClE,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;;;;OAIG;IACH,GAAG,EAAE;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,QAAQ,EAAE,MAAM,eAAe,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5E,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC;CACjB;AA8BD,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,wBAA6B,GAAG,iBAAiB,CAmWjG"}
|
package/dist/controller.js
CHANGED
|
@@ -172,6 +172,7 @@ export function createPreviewController(options = {}) {
|
|
|
172
172
|
buildVolume: r.buildVolume,
|
|
173
173
|
quality: r.quality ?? 'auto',
|
|
174
174
|
qualityMode: r.qualityMode,
|
|
175
|
+
progressivePreview: r.progressivePreview,
|
|
175
176
|
cameraMode: r.cameraMode,
|
|
176
177
|
frameContent: r.frameContent,
|
|
177
178
|
interactionQuality: r.interactionQuality,
|
|
@@ -180,7 +181,17 @@ export function createPreviewController(options = {}) {
|
|
|
180
181
|
theme: r.theme,
|
|
181
182
|
createRenderer: r.createRenderer,
|
|
182
183
|
scheduleFrame: r.scheduleFrame,
|
|
183
|
-
chunksPerTick: r.chunksPerTick
|
|
184
|
+
chunksPerTick: r.chunksPerTick,
|
|
185
|
+
// DD-028: parallel tube build. Default to the batteries-included browser Web Worker in a
|
|
186
|
+
// browser; Node/headless (no `Worker`) stays synchronous. A consumer can force `'off'`.
|
|
187
|
+
geometryConcurrency: r.geometryConcurrency,
|
|
188
|
+
geometryMemoryBudgetBytes: r.geometryMemoryBudgetBytes,
|
|
189
|
+
...(typeof navigator !== 'undefined' && Number.isFinite(navigator.hardwareConcurrency)
|
|
190
|
+
? { coreBudget: navigator.hardwareConcurrency }
|
|
191
|
+
: {}),
|
|
192
|
+
...(typeof Worker !== 'undefined' && r.geometryConcurrency !== 'off'
|
|
193
|
+
? { createGeometryWorker: mod.createBrowserGeometryWorker }
|
|
194
|
+
: {})
|
|
184
195
|
});
|
|
185
196
|
applyRendererReady(canvas, r3d);
|
|
186
197
|
})
|
|
@@ -195,6 +206,11 @@ export function createPreviewController(options = {}) {
|
|
|
195
206
|
const offProgress = session.onProgress((p) => {
|
|
196
207
|
mutate({ parseProgress: p });
|
|
197
208
|
emit({ type: 'parse-progress', progress: p });
|
|
209
|
+
// DD-029 staged progress: the parser's own phase maps to the preparation stage — `parsing` carries
|
|
210
|
+
// the real byte fraction; `finalizing` (where dialect annotation settles) surfaces as `classifying`.
|
|
211
|
+
// The renderer emits the later `building-geometry`/`preparing-gpu`/`ready` stages (forwarded below).
|
|
212
|
+
const fraction = p.totalBytes > 0 ? p.bytesProcessed / p.totalBytes : undefined;
|
|
213
|
+
emit({ type: 'stage', stage: p.phase === 'finalizing' ? 'classifying' : 'parsing', progress: fraction });
|
|
198
214
|
});
|
|
199
215
|
const offPartial = session.onPartial((slice) => {
|
|
200
216
|
renderer?.appendPartial(slice);
|
|
@@ -314,6 +330,7 @@ export function createPreviewController(options = {}) {
|
|
|
314
330
|
},
|
|
315
331
|
setQuality: (q) => withRenderer((r) => r.setQuality(q)),
|
|
316
332
|
setQualityMode: (m) => withRenderer((r) => r.setQualityMode(m)),
|
|
333
|
+
setProgressivePreview: (m) => withRenderer((r) => r.setProgressivePreview(m)),
|
|
317
334
|
setCameraMode: (m) => withRenderer((r) => r.setCameraMode(m)),
|
|
318
335
|
setView: (v) => withRenderer((r) => r.setView(v)),
|
|
319
336
|
// Returns a value, so it can't queue: before the renderer is ready (or on 2D) there is no pose → null.
|
package/dist/render-still.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* identity is NOT promised (antialiasing varies); cache by job identity.
|
|
20
20
|
*/
|
|
21
21
|
import { type SessionOptions, type WireParseOptions } from '@chestnutlabs/gcode-parser';
|
|
22
|
-
import { type BuildVolumeDef, type CameraMode, type ColorMode, type GLRendererLike, type QualityMode, type RenderTargetCanvas, type Theme, type ThemeColor, type TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
22
|
+
import { type BuildVolumeDef, type CameraMode, type ColorMode, type GeometryWorkerLike, type GLRendererLike, type QualityMode, type RenderTargetCanvas, type Theme, type ThemeColor, type TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
23
23
|
import { type MachineGeometry, type ToolpathIR } from '@chestnutlabs/toolpath-core';
|
|
24
24
|
/** Explicit camera pose (scene coordinates), overriding the deterministic frame(). */
|
|
25
25
|
export interface StillCameraPose {
|
|
@@ -69,6 +69,26 @@ export interface RenderStillOptions {
|
|
|
69
69
|
parseOptions?: WireParseOptions;
|
|
70
70
|
/** GL backend injection (tests / exotic hosts). Default: WebGLRenderer. */
|
|
71
71
|
createRenderer?: (canvas: RenderTargetCanvas) => GLRendererLike;
|
|
72
|
+
/**
|
|
73
|
+
* Parallel tube-geometry build for a big-plate still (DD-028 Phase 4). Default `'auto'` — in a
|
|
74
|
+
* browser-class context with `Worker` (the headless-Chromium sidecar, an Electron window) the batteries
|
|
75
|
+
* -included browser Web Worker pool builds tube chunks in parallel, byte-identical to serial. `'off'`
|
|
76
|
+
* forces the synchronous path. No effect where `Worker` is absent.
|
|
77
|
+
*/
|
|
78
|
+
geometryConcurrency?: 'auto' | 'off' | number;
|
|
79
|
+
/**
|
|
80
|
+
* Concurrency cap from the deployment's ACTUAL CPU grant (DD-028). `navigator.hardwareConcurrency`
|
|
81
|
+
* reports the visible cores, which over-reports a CFS-throttled container (e.g. 4 visible / 2.0-CPU
|
|
82
|
+
* quota → 2× oversubscription). A containerized caller (the sidecar) reads its cgroup `cpu.max` and
|
|
83
|
+
* passes the quota here; the pool sizes to `min(hardwareConcurrency, this) − 1`. Omit off-container.
|
|
84
|
+
*/
|
|
85
|
+
coreBudget?: number;
|
|
86
|
+
/** Max in-flight tube-geometry bytes for the parallel build (DD-028 memory backpressure). A memory-
|
|
87
|
+
* limited container (e.g. 2 GiB) passes a fraction of its limit; the pool never exceeds it. */
|
|
88
|
+
geometryMemoryBudgetBytes?: number;
|
|
89
|
+
/** Geometry-worker factory override (tests / exotic hosts). Defaults to the browser Web Worker when
|
|
90
|
+
* `Worker` is available and `geometryConcurrency !== 'off'`. */
|
|
91
|
+
createGeometryWorker?: () => GeometryWorkerLike;
|
|
72
92
|
}
|
|
73
93
|
export interface RenderStillResult {
|
|
74
94
|
/** The same canvas passed in, now holding the rendered frame. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-still.d.ts","sourceRoot":"","sources":["../src/render-still.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CA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U,GAAG,WAAW,GAAG,UAAU,EAC7C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAoJ5B"}
|
package/dist/render-still.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* identity is NOT promised (antialiasing varies); cache by job identity.
|
|
20
20
|
*/
|
|
21
21
|
import { GcodeParseSession } from '@chestnutlabs/gcode-parser';
|
|
22
|
-
import { ToolpathRenderer, createDefaultGLRenderer, machineToVolume } from '@chestnutlabs/gcode-renderer-three';
|
|
22
|
+
import { ToolpathRenderer, createDefaultGLRenderer, createBrowserGeometryWorker, machineToVolume } from '@chestnutlabs/gcode-renderer-three';
|
|
23
23
|
function isToolpathIR(v) {
|
|
24
24
|
return (typeof v === 'object' &&
|
|
25
25
|
v !== null &&
|
|
@@ -69,10 +69,33 @@ export async function renderStill(source, options) {
|
|
|
69
69
|
(transparent
|
|
70
70
|
? (c) => createDefaultGLRenderer(c, { alpha: true, preserveDrawingBuffer: true })
|
|
71
71
|
: undefined);
|
|
72
|
-
// Build to completion off the event loop (no rAF): microtask-scheduled ticks.
|
|
72
|
+
// Build to completion off the event loop (no rAF): microtask-scheduled ticks. `renderDuringBuild:
|
|
73
|
+
// false` suppresses the per-tick render — a still captures only the final frame, so rendering the
|
|
74
|
+
// partial scene on every one of the (potentially hundreds of) build ticks is pure waste and, in
|
|
75
|
+
// software WebGL, the dominant cost of a large still. The single frame()/render() below draws once.
|
|
76
|
+
// DD-028 Phase 4: parallelize the tube build for a big-plate still. renderStill runs in a browser-class
|
|
77
|
+
// WebGL2 context (headless Chromium / Electron / OffscreenCanvas worker — never raw Node), so the pool
|
|
78
|
+
// uses browser Web Workers. Default the batteries-included factory when `Worker` exists; a containerized
|
|
79
|
+
// caller passes `coreBudget` (its cgroup CPU quota) so the pool sizes to the throttle, not the visible
|
|
80
|
+
// core count — `navigator.hardwareConcurrency` over-reports a CFS-limited container.
|
|
81
|
+
const geometryPoolOpts = {};
|
|
82
|
+
if (options.geometryConcurrency !== 'off') {
|
|
83
|
+
const factory = options.createGeometryWorker ?? (typeof Worker !== 'undefined' ? createBrowserGeometryWorker : undefined);
|
|
84
|
+
if (factory !== undefined) {
|
|
85
|
+
geometryPoolOpts.geometryConcurrency = options.geometryConcurrency ?? 'auto';
|
|
86
|
+
geometryPoolOpts.createGeometryWorker = factory;
|
|
87
|
+
if (options.coreBudget !== undefined)
|
|
88
|
+
geometryPoolOpts.coreBudget = options.coreBudget;
|
|
89
|
+
if (options.geometryMemoryBudgetBytes !== undefined) {
|
|
90
|
+
geometryPoolOpts.geometryMemoryBudgetBytes = options.geometryMemoryBudgetBytes;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
73
94
|
const renderer = new ToolpathRenderer({
|
|
74
95
|
canvas,
|
|
75
96
|
quality: options.quality ?? 'auto',
|
|
97
|
+
renderDuringBuild: false,
|
|
98
|
+
...geometryPoolOpts,
|
|
76
99
|
...(options.cameraMode ? { cameraMode: options.cameraMode } : {}),
|
|
77
100
|
...(options.frameContent ? { frameContent: options.frameContent } : {}),
|
|
78
101
|
...(resolvedTheme ? { theme: resolvedTheme } : {}),
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* are documented no-ops. Nothing is ever drawn that the IR does not contain.
|
|
13
13
|
*/
|
|
14
14
|
import { type ColorMode, type TravelStyle } from '@chestnutlabs/gcode-renderer-2d';
|
|
15
|
-
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, QualityMode, QualityPolicy, Theme } from '@chestnutlabs/gcode-renderer-three';
|
|
15
|
+
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ProgressivePreview, QualityMode, QualityPolicy, Theme } from '@chestnutlabs/gcode-renderer-three';
|
|
16
16
|
import type { MachineGeometry, MappedProgress, ToolpathIR } from '@chestnutlabs/toolpath-core';
|
|
17
17
|
import type { MoveKindToggle, PreviewRenderer, PreviewRendererEvent } from './renderer-interface.js';
|
|
18
18
|
export interface LayerView2DRendererOptions {
|
|
@@ -54,6 +54,7 @@ export declare class LayerView2DRenderer implements PreviewRenderer {
|
|
|
54
54
|
private isColorModeAvailable;
|
|
55
55
|
setQuality(_quality: QualityMode | 'auto'): void;
|
|
56
56
|
setQualityMode(_mode: QualityPolicy): void;
|
|
57
|
+
setProgressivePreview(_mode: ProgressivePreview): void;
|
|
57
58
|
setCameraMode(_mode: CameraMode): void;
|
|
58
59
|
setView(_view: CameraView): void;
|
|
59
60
|
getCameraState(): CameraState | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-2d-adapter.d.ts","sourceRoot":"","sources":["../src/renderer-2d-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,KAAK,EACN,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAErG,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;CAC9B;AAED,qBAAa,mBAAoB,YAAW,eAAe;IAMvD,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IACnC,OAAO,CAAC,EAAE,CA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qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAKtD,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAItC,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIhC,cAAc,IAAI,WAAW,GAAG,IAAI;IAKpC,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIzC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI;IAI7B,WAAW,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI;IAM3C,WAAW,IAAI,MAAM,GAAG,IAAI;IAK5B,KAAK,IAAI,IAAI;IAKb,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -120,6 +120,10 @@ export class LayerView2DRenderer {
|
|
|
120
120
|
setQualityMode(_mode) {
|
|
121
121
|
// The fidelity policy (tubes/decimation) is a 3D concern; the flat 2D layer view has no equivalent.
|
|
122
122
|
}
|
|
123
|
+
setProgressivePreview(_mode) {
|
|
124
|
+
// The #60 progressive-preview curtain governs the 3D streaming line preview; the 2D view has
|
|
125
|
+
// its own low-resource progressive "cut" (DD-014) and no equivalent knob.
|
|
126
|
+
}
|
|
123
127
|
setCameraMode(_mode) {
|
|
124
128
|
this.disclose('camera', 'Camera projection applies only to the 3D renderer; the 2D view is flat top-down.');
|
|
125
129
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* pull Three.js into a 2D-only bundle. The 3D renderer's *values* are reached only through a
|
|
9
9
|
* dynamic `import()` in the controller, so a bundler drops Three.js when `mode` is `'2d'`.
|
|
10
10
|
*/
|
|
11
|
-
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, QualityMode, QualityPolicy, RendererEvent, Theme } from '@chestnutlabs/gcode-renderer-three';
|
|
11
|
+
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, ProgressivePreview, QualityMode, QualityPolicy, RendererEvent, Theme } from '@chestnutlabs/gcode-renderer-three';
|
|
12
12
|
export type { CameraState, CameraView } from '@chestnutlabs/gcode-renderer-three';
|
|
13
13
|
import type { MachineGeometry, MappedProgress, ToolpathIR } from '@chestnutlabs/toolpath-core';
|
|
14
14
|
/** Which renderer implementation backs the preview. `'3d'` is the default (Three.js). */
|
|
@@ -55,6 +55,11 @@ export interface PreviewRenderer {
|
|
|
55
55
|
setQuality(quality: QualityMode | 'auto'): void;
|
|
56
56
|
/** Fidelity policy (DD-023 §4 D6): 'full' | 'adaptive' | 'fast'. 3D only; 2D is a no-op. */
|
|
57
57
|
setQualityMode(mode: QualityPolicy): void;
|
|
58
|
+
/**
|
|
59
|
+
* During-parse preview curtain (#60): 'lines' | 'hold' | 'off'. Applies to the NEXT parse.
|
|
60
|
+
* 3D only; 2D is a no-op.
|
|
61
|
+
*/
|
|
62
|
+
setProgressivePreview(mode: ProgressivePreview): void;
|
|
58
63
|
setCameraMode(mode: CameraMode): void;
|
|
59
64
|
/** Snap to a preset orientation (#268). 2D renderers disclose via `renderer-unsupported`. */
|
|
60
65
|
setView(view: CameraView): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-interface.d.ts","sourceRoot":"","sources":["../src/renderer-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACN,MAAM,oCAAoC,CAAC;AAE5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE/F,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3D;;;;GAIG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,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IACvC,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;IAChD,4FAA4F;IAC5F,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtD,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,6GAA6G;IAC7G,cAAc,IAAI,WAAW,GAAG,IAAI,CAAC;IACrC,mGAAmG;IACnG,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5C;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3E,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chestnutlabs/gcode-preview-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Framework-neutral preview controller for the Chestnut Labs G-code viewer (DD-007 §4.6): the shared engine glue, state model, and TypeScript contracts beneath the Vue/React/Svelte adapters.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gcode",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"test": "vitest run"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@chestnutlabs/gcode-parser": "0.
|
|
56
|
-
"@chestnutlabs/gcode-renderer-2d": "0.
|
|
57
|
-
"@chestnutlabs/gcode-renderer-three": "0.
|
|
58
|
-
"@chestnutlabs/toolpath-core": "0.
|
|
55
|
+
"@chestnutlabs/gcode-parser": "0.16.0",
|
|
56
|
+
"@chestnutlabs/gcode-renderer-2d": "0.16.0",
|
|
57
|
+
"@chestnutlabs/gcode-renderer-three": "0.16.0",
|
|
58
|
+
"@chestnutlabs/toolpath-core": "0.16.0"
|
|
59
59
|
}
|
|
60
60
|
}
|