@chestnutlabs/gcode-preview-vue 0.13.0 → 0.15.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.
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* and staying pure TypeScript keeps the package on the plain tsc build with typed props/emits.
|
|
11
11
|
*/
|
|
12
12
|
import { type PropType } from 'vue';
|
|
13
|
-
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, QualityMode, Theme, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
13
|
+
import type { BuildVolumeDef, CameraMode, CameraState, CameraView, ColorMode, QualityMode, ProgressivePreview, QualityPolicy, Theme, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
14
14
|
import type { Confidence, DialectMetadata, Warning } from '@chestnutlabs/toolpath-core';
|
|
15
15
|
import type { MachineGeometry, ProgressObservation } from '@chestnutlabs/toolpath-core';
|
|
16
16
|
import type { WireParseOptions, WorkerLike } from '@chestnutlabs/gcode-parser';
|
|
@@ -45,6 +45,15 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
45
45
|
type: PropType<QualityMode | "auto">;
|
|
46
46
|
default: string;
|
|
47
47
|
};
|
|
48
|
+
qualityMode: {
|
|
49
|
+
type: PropType<QualityPolicy>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
/** #60 curtain: 'lines' (default, stream the preview), 'hold' (reveal only the final build), or 'off'. */
|
|
53
|
+
progressivePreview: {
|
|
54
|
+
type: PropType<ProgressivePreview>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
48
57
|
/** #150 (DD-009 D3): camera projection. */
|
|
49
58
|
cameraMode: {
|
|
50
59
|
type: PropType<CameraMode>;
|
|
@@ -130,7 +139,7 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
130
139
|
};
|
|
131
140
|
/** Advanced/test renderer injectables (pass-throughs of the renderer contract). */
|
|
132
141
|
rendererOptions: {
|
|
133
|
-
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">>;
|
|
142
|
+
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "qualityMode" | "progressivePreview" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">>;
|
|
134
143
|
default: undefined;
|
|
135
144
|
};
|
|
136
145
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -203,6 +212,15 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
203
212
|
type: PropType<QualityMode | "auto">;
|
|
204
213
|
default: string;
|
|
205
214
|
};
|
|
215
|
+
qualityMode: {
|
|
216
|
+
type: PropType<QualityPolicy>;
|
|
217
|
+
default: undefined;
|
|
218
|
+
};
|
|
219
|
+
/** #60 curtain: 'lines' (default, stream the preview), 'hold' (reveal only the final build), or 'off'. */
|
|
220
|
+
progressivePreview: {
|
|
221
|
+
type: PropType<ProgressivePreview>;
|
|
222
|
+
default: undefined;
|
|
223
|
+
};
|
|
206
224
|
/** #150 (DD-009 D3): camera projection. */
|
|
207
225
|
cameraMode: {
|
|
208
226
|
type: PropType<CameraMode>;
|
|
@@ -288,7 +306,7 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
288
306
|
};
|
|
289
307
|
/** Advanced/test renderer injectables (pass-throughs of the renderer contract). */
|
|
290
308
|
rendererOptions: {
|
|
291
|
-
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">>;
|
|
309
|
+
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "qualityMode" | "progressivePreview" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">>;
|
|
292
310
|
default: undefined;
|
|
293
311
|
};
|
|
294
312
|
}>> & Readonly<{
|
|
@@ -335,6 +353,8 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
335
353
|
renderer: RendererMode;
|
|
336
354
|
buildVolume: BuildVolumeDef | MachineGeometry;
|
|
337
355
|
quality: QualityMode | "auto";
|
|
356
|
+
qualityMode: QualityPolicy;
|
|
357
|
+
progressivePreview: ProgressivePreview;
|
|
338
358
|
cameraMode: CameraMode;
|
|
339
359
|
frameContent: "object" | "all";
|
|
340
360
|
interactionQuality: "auto" | "off";
|
|
@@ -358,6 +378,8 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
358
378
|
mode?: RendererMode;
|
|
359
379
|
buildVolume?: BuildVolumeDef;
|
|
360
380
|
quality?: QualityMode | "auto";
|
|
381
|
+
qualityMode?: QualityPolicy;
|
|
382
|
+
progressivePreview?: ProgressivePreview;
|
|
361
383
|
cameraMode?: CameraMode;
|
|
362
384
|
frameContent?: "object" | "all";
|
|
363
385
|
interactionQuality?: "off" | "auto";
|
|
@@ -369,6 +391,6 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
369
391
|
createRenderer?: (canvas: import("@chestnutlabs/gcode-renderer-three").RenderTargetCanvas) => import("@chestnutlabs/gcode-renderer-three").GLRendererLike;
|
|
370
392
|
scheduleFrame?: (cb: () => void) => void;
|
|
371
393
|
chunksPerTick?: number;
|
|
372
|
-
}, "buildVolume" | "quality" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">;
|
|
394
|
+
}, "buildVolume" | "quality" | "qualityMode" | "progressivePreview" | "cameraMode" | "frameContent" | "interactionQuality" | "theme" | "colorMode" | "tube">;
|
|
373
395
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
374
396
|
//# sourceMappingURL=gcode-preview-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcode-preview-component.d.ts","sourceRoot":"","sources":["../src/gcode-preview-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA6C,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,WAAW,EACX,KAAK,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAExE,eAAO,MAAM,YAAY;IAGrB,qFAAqF;;cAC1B,QAAQ,CAAC,kBAAkB,CAAC;;;;cACvD,QAAQ,CAAC,gBAAgB,CAAC;;;IAC1D,qGAAqG;;cACzE,QAAQ,CAAC,YAAY,CAAC;;;IAClD,uGAAuG;;cACrE,QAAQ,CAAC,MAAM,CAAC;;;IAClD,2FAA2F;;cAC5D,QAAQ,CAAC,cAAc,GAAG,eAAe,CAAC;;;;cAC9C,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC;;;
|
|
1
|
+
{"version":3,"file":"gcode-preview-component.d.ts","sourceRoot":"","sources":["../src/gcode-preview-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA6C,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,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AAC,MAAM,GAAG,IAAI,CAAC;;;;;;;IAEpD,2DAA2D;;;;;IAE3D,gEAAgE;;;;;IAEhE,kGAAkG;;;;;IAElG,gEAAgE;;cACpC,QAAQ,CAAC,mBAAmB,GAAG,IAAI,CAAC;;;IAChE;sFACkF;;cAE9D,QAAQ,CAAC,MAAM,UAAU,CAAC;;;IAG9C,mFAAmF;;cAEjE,QAAQ,CACtB,IAAI,CACF,WAAW,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,EAC7C,aAAa,GACb,SAAS,GACT,aAAa,GACb,oBAAoB,GACpB,YAAY,GACZ,cAAc,GACd,oBAAoB,GACpB,OAAO,GACP,WAAW,GACX,MAAM,CACT,CACF;;;;;;cAwBiB,MAAM;iBAAW,MAAM;;;kBAjB/B,MAAM;gBACR,MAAM;kBACJ,OAAO;sBACH,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;kBAC9B,SAAS,OAAO,EAAE;kBAClB,eAAe,GAAG,SAAS;;;;cAGX,MAAM;iBAAW,MAAM;;;;wBAEV,MAAM;oBAAc,MAAM;;;kBAChC,MAAM;iBAAW,WAAW;;;cAC9B,WAAW;YAAM,WAAW;gBAAU,MAAM;;;;;cAG/B,MAAM;iBAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAzClC,UAAU;;;;;;;;;;;;;;;;;;;4EAyQ/C,CAAC"}
|
|
@@ -24,6 +24,9 @@ export const GcodePreview = defineComponent({
|
|
|
24
24
|
/** Consumer-configured volume — wins over file-discovered geometry (DD-005 precedence). */
|
|
25
25
|
buildVolume: { type: Object, default: undefined },
|
|
26
26
|
quality: { type: String, default: 'auto' },
|
|
27
|
+
qualityMode: { type: String, default: undefined },
|
|
28
|
+
/** #60 curtain: 'lines' (default, stream the preview), 'hold' (reveal only the final build), or 'off'. */
|
|
29
|
+
progressivePreview: { type: String, default: undefined },
|
|
27
30
|
/** #150 (DD-009 D3): camera projection. */
|
|
28
31
|
cameraMode: { type: String, default: 'perspective' },
|
|
29
32
|
/** #306/#6: frame the printed 'object' (excl. skirt/prime) or 'all' extrusion. Default 'all'. */
|
|
@@ -88,6 +91,8 @@ export const GcodePreview = defineComponent({
|
|
|
88
91
|
mode: props.renderer,
|
|
89
92
|
buildVolume: 'bed' in (props.buildVolume ?? {}) ? undefined : props.buildVolume,
|
|
90
93
|
quality: props.quality,
|
|
94
|
+
qualityMode: props.qualityMode,
|
|
95
|
+
progressivePreview: props.progressivePreview,
|
|
91
96
|
cameraMode: props.cameraMode,
|
|
92
97
|
frameContent: props.frameContent,
|
|
93
98
|
interactionQuality: props.interactionQuality,
|
|
@@ -185,6 +190,14 @@ export const GcodePreview = defineComponent({
|
|
|
185
190
|
preview.controls.setColorMode(mode);
|
|
186
191
|
});
|
|
187
192
|
watch(() => props.quality, (quality) => preview.controls.setQuality(quality));
|
|
193
|
+
watch(() => props.qualityMode, (mode) => {
|
|
194
|
+
if (mode !== undefined)
|
|
195
|
+
preview.controls.setQualityMode(mode);
|
|
196
|
+
});
|
|
197
|
+
watch(() => props.progressivePreview, (mode) => {
|
|
198
|
+
if (mode !== undefined)
|
|
199
|
+
preview.controls.setProgressivePreview(mode);
|
|
200
|
+
});
|
|
188
201
|
watch(() => props.cameraMode, (mode) => preview.controls.setCameraMode(mode));
|
|
189
202
|
watch(() => props.frameContent, (mode) => preview.controls.setFrameContent(mode));
|
|
190
203
|
watch(() => props.interactionQuality, (mode) => preview.controls.setInteractionQuality(mode));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chestnutlabs/gcode-preview-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Thin Vue 3 integration for the Chestnut Labs G-code viewer (DD-007): useGcodePreview composable + GcodePreview component over the framework-neutral parser/renderer/progress packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gcode",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"test": "vitest run"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@chestnutlabs/gcode-parser": "0.
|
|
54
|
-
"@chestnutlabs/gcode-renderer-three": "0.
|
|
55
|
-
"@chestnutlabs/toolpath-core": "0.
|
|
56
|
-
"@chestnutlabs/gcode-preview-core": "0.
|
|
53
|
+
"@chestnutlabs/gcode-parser": "0.15.0",
|
|
54
|
+
"@chestnutlabs/gcode-renderer-three": "0.15.0",
|
|
55
|
+
"@chestnutlabs/toolpath-core": "0.15.0",
|
|
56
|
+
"@chestnutlabs/gcode-preview-core": "0.15.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"vue": "^3.4.0"
|