three-slicer 0.1.6 → 0.2.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/CHANGELOG.md +35 -0
- package/README.md +310 -22
- package/THIRD-PARTY-NOTICES.md +37 -0
- package/components/README.md +2 -0
- package/components/dist/SettingsPanel.js +92 -92
- package/data/config-schema.json +698 -0
- package/data/filaments.js +1 -1
- package/data/preset-keys.json +1 -0
- package/data/printers.json +1 -1
- package/data/processes.js +1 -1
- package/data/ui-tree.json +342 -0
- package/engine/README.md +279 -3
- package/engine/examples/sla_headless.mjs +51 -0
- package/engine/index.d.ts +77 -5
- package/engine/index.js +15 -4
- package/engine/src/client.js +165 -0
- package/engine/src/data.js +3 -0
- package/engine/src/preset_file.js +99 -0
- package/engine/src/settings.js +232 -0
- package/engine/src/sla_core.js +188 -0
- package/engine/src/sla_request.js +185 -0
- package/engine/src/slicer.worker.js +76 -4
- package/engine/src/slicer_core.js +0 -0
- package/engine/src/slicer_core.mt.js +0 -0
- package/package.json +26 -11
- package/types/client.d.ts +88 -0
- package/types/components.d.ts +10 -0
- package/types/data/preset-keys.json.d.ts +20 -0
- package/types/data/printers.json.d.ts +2 -2
- package/types/data.d.ts +4 -0
- package/types/settings-keys.d.ts +107 -1
- package/types/settings.d.ts +116 -1
- package/types/sla.d.ts +167 -0
- package/types/viewer.d.ts +59 -1
- package/types/worker.d.ts +95 -0
- package/viewer/README.md +163 -3
- package/viewer/dist/Viewport.js +3633 -3137
- package/viewer/dist/model_loaders.js +1 -1
- package/viewer/dist/parse_3mf-C2X_W442.js +300 -0
- package/viewer/dist/parse_3mf.worker.js +1 -1
- package/viewer/styles.css +5 -0
- package/types/gen_settings_types.mjs +0 -70
- package/viewer/dist/parse_3mf-8oCnCJNK.js +0 -216
|
@@ -11,17 +11,26 @@
|
|
|
11
11
|
// Automatic multithreaded kernel selection: with crossOriginIsolated (sites serving COOP/COEP) it uses mt (-pthread, PASS1
|
|
12
12
|
// layers in parallel — measured 2.2x), otherwise st (zero-config). The dynamic import makes bundlers emit both as chunks,
|
|
13
13
|
// but only one is loaded at runtime. On mt init failure (SAB blocked, …) it falls back to st.
|
|
14
|
+
// Which kernel loaded is worth saying once — mt vs st is a 2x difference and the fallback is silent otherwise.
|
|
15
|
+
// A host embedding the viewer in its own product can switch it off (`<Viewport features={{ logs: false }} />`,
|
|
16
|
+
// which sets `quiet` on the messages it sends): this is a separate module instance from the viewer's log.js and
|
|
17
|
+
// cannot read a flag set over there.
|
|
18
|
+
import { assertLegacySlaFallback, parseSlaJob } from './sla_request.js'
|
|
19
|
+
|
|
20
|
+
let quiet = false
|
|
21
|
+
const say = (level, ...args) => { if (!quiet) console[level](...args) }
|
|
22
|
+
|
|
14
23
|
const loadCore = async () => {
|
|
15
24
|
const isolated = typeof crossOriginIsolated !== 'undefined' && crossOriginIsolated
|
|
16
25
|
if (isolated) {
|
|
17
26
|
try {
|
|
18
27
|
const M = await (await import('./slicer_core.mt.js')).default()
|
|
19
|
-
|
|
28
|
+
say('info', '[slicer.worker] core: mt (threads)')
|
|
20
29
|
return M
|
|
21
|
-
} catch (e) {
|
|
30
|
+
} catch (e) { say('warn', '[slicer.worker] mt load failed — falling back to st:', e) }
|
|
22
31
|
}
|
|
23
32
|
const M = await (await import('./slicer_core.js')).default()
|
|
24
|
-
|
|
33
|
+
say('info', '[slicer.worker] core: st')
|
|
25
34
|
return M
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -108,6 +117,9 @@ const paintedReply = (Module, message, paintedState) => {
|
|
|
108
117
|
|
|
109
118
|
self.onmessage = async (e) => {
|
|
110
119
|
const d = e.data
|
|
120
|
+
// Read before the kernel loads: loadCore() below is what prints, so a `quiet` arriving with the first message
|
|
121
|
+
// (the warmup) has to take effect before that call, not after it.
|
|
122
|
+
if (d.quiet !== undefined) quiet = !!d.quiet
|
|
111
123
|
try {
|
|
112
124
|
// Asking for the painting must not be what LOADS the kernel. Every other command needs it, but if this worker
|
|
113
125
|
// has never loaded it then selector_prepare has never run either, so there is no painting to report — and
|
|
@@ -115,6 +127,66 @@ self.onmessage = async (e) => {
|
|
|
115
127
|
if (d.cmd === 'exportPaint' && !modPromise) {
|
|
116
128
|
self.postMessage({ type: 'paintExport', supported: false, facets: [], hex: '' }); return
|
|
117
129
|
}
|
|
130
|
+
if (d.cmd === 'slaJob') {
|
|
131
|
+
const job = parseSlaJob(d.job)
|
|
132
|
+
if (!modPromise) modPromise = loadCore()
|
|
133
|
+
const Kernel = await modPromise
|
|
134
|
+
const onProgress = (done, total) => self.postMessage({ type: 'progress', done, total })
|
|
135
|
+
if (Kernel.slice_sla_job) {
|
|
136
|
+
Kernel.set_layer_sink((z, idx, gcode, paths, widths) => {
|
|
137
|
+
const transfer = []
|
|
138
|
+
if (paths?.buffer) transfer.push(paths.buffer)
|
|
139
|
+
if (widths?.buffer) transfer.push(widths.buffer)
|
|
140
|
+
self.postMessage({ type: 'layer', z, idx, gcode: '', paths, widths }, transfer)
|
|
141
|
+
})
|
|
142
|
+
let r
|
|
143
|
+
try { r = Kernel.slice_sla_job(job, onProgress) }
|
|
144
|
+
finally { Kernel.clear_layer_sink() }
|
|
145
|
+
if (r?.error) { self.postMessage({ type: 'error', error: String(r.error) }); return }
|
|
146
|
+
self.postMessage({ type: 'done', result: r }); return
|
|
147
|
+
}
|
|
148
|
+
self.postMessage({ type: 'error', code: 'SLA_UNSUPPORTED_OBJECT_AWARE',
|
|
149
|
+
error: 'Object-aware SLA slicing requires WASM kernel support' })
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
// SLA slicing runs in the WASM kernel (slice_sla — contours + generated supports, C++ Clipper speed), through
|
|
153
|
+
// the same layer-sink streaming a kernel slice uses. The pure-JS contour slicer (sla_core.js) stays as the
|
|
154
|
+
// fallback for a loaded kernel that predates the binding — it produces the same stream, minus the supports.
|
|
155
|
+
if (d.cmd === 'sla') {
|
|
156
|
+
const params = typeof d.params === 'string' ? d.params : JSON.stringify(d.params ?? {})
|
|
157
|
+
if (!modPromise) modPromise = loadCore()
|
|
158
|
+
const Kernel = await modPromise
|
|
159
|
+
const onProgress = (done, total) => self.postMessage({ type: 'progress', done, total })
|
|
160
|
+
if (Kernel.slice_sla) {
|
|
161
|
+
Kernel.set_layer_sink((z, idx, gcode, paths, widths) => {
|
|
162
|
+
const transfer = []
|
|
163
|
+
if (paths && paths.buffer) transfer.push(paths.buffer)
|
|
164
|
+
if (widths && widths.buffer) transfer.push(widths.buffer)
|
|
165
|
+
self.postMessage({ type: 'layer', z, idx, gcode: '', paths, widths }, transfer)
|
|
166
|
+
})
|
|
167
|
+
let r
|
|
168
|
+
try { r = Kernel.slice_sla(new Uint8Array(d.stl), params, onProgress) }
|
|
169
|
+
finally { Kernel.clear_layer_sink() }
|
|
170
|
+
if (r && r.error) { self.postMessage({ type: 'error', error: String(r.error) }); return }
|
|
171
|
+
self.postMessage({ type: 'done', result: r })
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
const { sliceSla } = await import('./sla_core.js')
|
|
175
|
+
const fallbackParams = JSON.parse(params)
|
|
176
|
+
assertLegacySlaFallback(fallbackParams)
|
|
177
|
+
const r = sliceSla(new Uint8Array(d.stl), fallbackParams, {
|
|
178
|
+
onProgress,
|
|
179
|
+
onLayer: (L) => {
|
|
180
|
+
const transfer = []
|
|
181
|
+
if (L.paths?.buffer) transfer.push(L.paths.buffer)
|
|
182
|
+
if (L.widths?.buffer) transfer.push(L.widths.buffer)
|
|
183
|
+
self.postMessage({ type: 'layer', z: L.z, idx: L.idx, gcode: '', paths: L.paths, widths: L.widths }, transfer)
|
|
184
|
+
},
|
|
185
|
+
})
|
|
186
|
+
if (r && r.error) { self.postMessage({ type: 'error', error: String(r.error) }); return }
|
|
187
|
+
self.postMessage({ type: 'done', result: r })
|
|
188
|
+
return
|
|
189
|
+
}
|
|
118
190
|
if (!modPromise) modPromise = loadCore()
|
|
119
191
|
const Module = await modPromise
|
|
120
192
|
// Warmup: only load the kernel (+ spawn the mt pthread pool) ahead of time — removes the perceived load on the first slice
|
|
@@ -237,6 +309,6 @@ self.onmessage = async (e) => {
|
|
|
237
309
|
self.postMessage({ type: 'done', result: r })
|
|
238
310
|
} catch (err) {
|
|
239
311
|
// Includes the WASM abort("memory access out of bounds") — the main thread's OOM ladder decides on re-creation / economy retry.
|
|
240
|
-
self.postMessage({ type: 'error', error: String((err && err.message) || err) })
|
|
312
|
+
self.postMessage({ type: 'error', error: String((err && err.message) || err), ...(err?.code ? { code: err.code } : {}) })
|
|
241
313
|
}
|
|
242
314
|
}
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "three-slicer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Browser/WASM 3D-printing slicer reverse-engineered from OrcaSlicer: slicing engine (Arachne walls, tree/grid supports, multi-material), React viewer with GPU toolpath preview, and schema-driven settings UI.",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Browser/WASM 3D-printing slicer reverse-engineered from OrcaSlicer: slicing engine (Arachne walls, tree/grid supports, multi-material), SLA resin slicing with PrusaSlicer's ported support/pad chain and .sl1 export, React viewer with GPU toolpath preview, and schema-driven settings UI.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"types": "./types/worker.d.ts",
|
|
22
22
|
"default": "./engine/src/slicer.worker.js"
|
|
23
23
|
},
|
|
24
|
+
"./client": {
|
|
25
|
+
"types": "./types/client.d.ts",
|
|
26
|
+
"default": "./engine/src/client.js"
|
|
27
|
+
},
|
|
24
28
|
"./wasm": {
|
|
25
29
|
"types": "./types/wasm.d.ts",
|
|
26
30
|
"default": "./engine/src/slicer_core.js"
|
|
@@ -56,10 +60,12 @@
|
|
|
56
60
|
"./data/*": {
|
|
57
61
|
"types": "./types/data/*.d.ts",
|
|
58
62
|
"default": "./data/*"
|
|
59
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"./package.json": "./package.json"
|
|
60
65
|
},
|
|
66
|
+
"sideEffects": false,
|
|
61
67
|
"scripts": {
|
|
62
|
-
"build": "node types/gen_settings_types.mjs && vite build --config components/vite.config.js && vite build --config viewer/vite.config.js && cp viewer/src/make_worker.js viewer/dist/make_worker.js",
|
|
68
|
+
"build": "node types/gen_settings_types.mjs && node types/gen_kernel_params.mjs && vite build --config components/vite.config.js && vite build --config viewer/vite.config.js && cp viewer/src/make_worker.js viewer/dist/make_worker.js",
|
|
63
69
|
"check": "bash pack_check.sh"
|
|
64
70
|
},
|
|
65
71
|
"peerDependencies": {
|
|
@@ -67,6 +73,11 @@
|
|
|
67
73
|
"react-dom": ">=18",
|
|
68
74
|
"three": "^0.160.0"
|
|
69
75
|
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"react": { "optional": true },
|
|
78
|
+
"react-dom": { "optional": true },
|
|
79
|
+
"three": { "optional": true }
|
|
80
|
+
},
|
|
70
81
|
"devDependencies": {
|
|
71
82
|
"typescript": "^5.6.0",
|
|
72
83
|
"vite": "^5.4.11"
|
|
@@ -75,18 +86,18 @@
|
|
|
75
86
|
"engine",
|
|
76
87
|
"!engine/**/.omc",
|
|
77
88
|
"types",
|
|
89
|
+
"!**/test_*.mjs",
|
|
90
|
+
"!types/gen_*.mjs",
|
|
78
91
|
"components/dist",
|
|
79
92
|
"viewer/dist",
|
|
80
93
|
"viewer/styles.css",
|
|
81
94
|
"components/styles.css",
|
|
82
|
-
"data
|
|
83
|
-
"data/
|
|
84
|
-
"data
|
|
85
|
-
"data/invalidation-map.json",
|
|
86
|
-
"data/printers.json",
|
|
87
|
-
"data/processes.js",
|
|
88
|
-
"data/filaments.js",
|
|
95
|
+
"data",
|
|
96
|
+
"!data/config-schema-builddump.json",
|
|
97
|
+
"!data/**/.omc",
|
|
89
98
|
"README.md",
|
|
99
|
+
"CHANGELOG.md",
|
|
100
|
+
"THIRD-PARTY-NOTICES.md",
|
|
90
101
|
"LICENSE.txt"
|
|
91
102
|
],
|
|
92
103
|
"repository": {
|
|
@@ -99,6 +110,10 @@
|
|
|
99
110
|
"3d-printing",
|
|
100
111
|
"slicer",
|
|
101
112
|
"gcode",
|
|
113
|
+
"sla",
|
|
114
|
+
"resin",
|
|
115
|
+
"sl1",
|
|
116
|
+
"msla",
|
|
102
117
|
"stl",
|
|
103
118
|
"wasm",
|
|
104
119
|
"orcaslicer",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// three-slicer/client — promise wrapper over the worker protocol in three-slicer/worker.
|
|
2
|
+
import type { SliceLayer, SliceResult } from '../engine/index.d.ts'
|
|
3
|
+
import type { BrushArgs, PaintState, PaintTool } from './worker.d.ts'
|
|
4
|
+
import type { SlaJob } from './sla.d.ts'
|
|
5
|
+
|
|
6
|
+
export type { BrushArgs, PaintState, PaintTool }
|
|
7
|
+
// Value re-exports must not name the .d.ts directly (TS2846) — the .js specifier resolves to sla.d.ts.
|
|
8
|
+
export { SLA_CAPABILITIES, SLA_JOB_VERSION, SlaRequestError } from './sla.js'
|
|
9
|
+
export type * from './sla.d.ts'
|
|
10
|
+
|
|
11
|
+
export interface ClientSliceCallbacks {
|
|
12
|
+
onProgress?: (done: number, total: number) => void
|
|
13
|
+
/** Takes the layers yourself. With it set, the result carries stats only and nothing is buffered here. */
|
|
14
|
+
onLayer?: (layer: SliceLayer) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Painted facet counts. `counts` is present only when the call named states. */
|
|
18
|
+
export interface PaintCounts {
|
|
19
|
+
/** State 1 — the support enforcer, and Extruder 1 */
|
|
20
|
+
enforcer: number
|
|
21
|
+
/** State 2 — the support blocker, and Extruder 2 */
|
|
22
|
+
blocker: number
|
|
23
|
+
counts?: Record<number, number>
|
|
24
|
+
/** Facets an importPaint actually applied */
|
|
25
|
+
applied?: number
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface PaintOverlays {
|
|
29
|
+
enforcer: Float32Array
|
|
30
|
+
blocker: Float32Array
|
|
31
|
+
overlays?: Record<number, Float32Array>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface SlicerClient {
|
|
35
|
+
/** The worker being driven — for a host that also wants to listen in. */
|
|
36
|
+
worker: Worker
|
|
37
|
+
|
|
38
|
+
/** Load the kernel ahead of the first slice. */
|
|
39
|
+
warmup(): Promise<void>
|
|
40
|
+
|
|
41
|
+
/** `params` may be an object; it is stringified for you, which the raw protocol does not do. */
|
|
42
|
+
slice(stl: ArrayBuffer | Uint8Array, params: object | string, cb?: ClientSliceCallbacks): Promise<SliceResult>
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Legacy single-object SLA (resin) slice. The JS fallback is contour-only and returns a typed error instead of
|
|
46
|
+
* silently dropping requested supports or pads. Stats carry `sla: true`, `resin_ml` and `time_estimate` instead of
|
|
47
|
+
* filament/G-code figures, and no G-code is produced.
|
|
48
|
+
*/
|
|
49
|
+
sliceSla(stl: ArrayBuffer | Uint8Array, params: object | string, cb?: ClientSliceCallbacks): Promise<SliceResult>
|
|
50
|
+
|
|
51
|
+
/** Object-aware SLA job. Objects retain their order, instances and support context for the WASM job bridge. */
|
|
52
|
+
sliceSlaJob(job: SlaJob, cb?: ClientSliceCallbacks): Promise<SliceResult>
|
|
53
|
+
|
|
54
|
+
/** Register a mesh for painting. `keepPaint` carries existing marks across a move; `kept` says whether they survived. */
|
|
55
|
+
prepare(stl: ArrayBuffer | Uint8Array, opts?: { keepPaint?: boolean }): Promise<{ facets: number; kept: boolean }>
|
|
56
|
+
|
|
57
|
+
paint(args: BrushArgs & {
|
|
58
|
+
state?: PaintState; enforcer?: boolean; tool?: PaintTool
|
|
59
|
+
angle?: number; cursor?: 'sphere' | 'circle'; states?: PaintState[]
|
|
60
|
+
}): Promise<PaintCounts>
|
|
61
|
+
|
|
62
|
+
/** Back to the default extruder. A separate call, not `paint` with state 0 — see three-slicer/worker. */
|
|
63
|
+
erase(args: BrushArgs & { tool?: PaintTool; angle?: number; states?: PaintState[] }): Promise<PaintCounts>
|
|
64
|
+
|
|
65
|
+
clear(states?: PaintState[]): Promise<PaintCounts>
|
|
66
|
+
overlay(states?: PaintState[]): Promise<PaintOverlays>
|
|
67
|
+
|
|
68
|
+
/** Load a 3mf's painting. Replaces every mark, so run it directly after `prepare`. */
|
|
69
|
+
importPaint(facets: Int32Array | number[], hex: string, states?: PaintState[]): Promise<PaintCounts>
|
|
70
|
+
exportPaint(): Promise<{ supported: boolean; facets: number[]; hex: string }>
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Stop the running slice. Works while the worker is blocked in WASM, but the flag lives in a SharedArrayBuffer,
|
|
74
|
+
* so it exists only on the multithreaded kernel — a cross-origin-isolated page. Returns false when there is no
|
|
75
|
+
* flag to write; terminate the worker instead.
|
|
76
|
+
*/
|
|
77
|
+
cancel(): boolean
|
|
78
|
+
|
|
79
|
+
/** Kill the worker and reject everything still in flight. */
|
|
80
|
+
terminate(): void
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @param worker an existing worker to drive. Omitted, one is created — browser only, since Node has no global
|
|
85
|
+
* `Worker`; in Node use `createSlicer()` from the root entry instead.
|
|
86
|
+
*/
|
|
87
|
+
export function createSlicerClient(worker?: Worker): SlicerClient
|
|
88
|
+
export default createSlicerClient
|
package/types/components.d.ts
CHANGED
|
@@ -13,6 +13,16 @@ export interface SettingsPanelProps {
|
|
|
13
13
|
embedded?: boolean
|
|
14
14
|
/** Replace schema-driven widgets per key (e.g. `{ printable_area: MyBedEditor }`) */
|
|
15
15
|
customWidgets?: Record<string, React.ComponentType<any>>
|
|
16
|
+
/**
|
|
17
|
+
* Pins the panel to one builder (optionally one page) and drops the search/group/page/mode chrome, so the form
|
|
18
|
+
* can be folded into another card. This is how `<Viewport/>`'s `motionPanel` slot is meant to be filled:
|
|
19
|
+
*
|
|
20
|
+
* ```jsx
|
|
21
|
+
* <SettingsPanel settings={settings} setSettings={setSettings} embedded
|
|
22
|
+
* only={{ builder: 'TabPrinter::build_kinematics_page' }} />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
only?: { builder: string; page?: string }
|
|
16
26
|
}
|
|
17
27
|
|
|
18
28
|
declare const SettingsPanel: React.FC<SettingsPanelProps>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// preset-keys.json — which option keys belong to which preset type, extracted from upstream's Preset.cpp
|
|
2
|
+
// (`s_Preset_print_options`, `s_Preset_filament_options`, and printer_options() = printer + machine limits +
|
|
3
|
+
// the per-extruder keys from PrintConfig.cpp).
|
|
4
|
+
//
|
|
5
|
+
// Distinct from printers.json's `keys`, which is the 21 columns the kernel reads: that is what a picker needs,
|
|
6
|
+
// this is what writing a preset FILE another slicer will accept needs. Keys the config schema does not define are
|
|
7
|
+
// dropped at extraction — every consumer coerces by schema type, so an untyped key could not be handled anyway.
|
|
8
|
+
// Read it through `presetOptionKeys()` in three-slicer/settings rather than indexing this by hand.
|
|
9
|
+
|
|
10
|
+
export interface PresetKeyLists {
|
|
11
|
+
/** Machine preset options — upstream's `Preset::printer_options()` */
|
|
12
|
+
printer: string[]
|
|
13
|
+
/** Print (process) preset options */
|
|
14
|
+
process: string[]
|
|
15
|
+
/** Filament preset options */
|
|
16
|
+
filament: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const presetKeys: PresetKeyLists
|
|
20
|
+
export default presetKeys
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
/** A positional row aligned to `keys`; `null` where the profile chain never set that option. */
|
|
8
8
|
export type PrinterRow = (unknown | null)[]
|
|
9
9
|
|
|
10
|
-
/** `[nozzle diameter, index into sets, model name without the nozzle suffix]` */
|
|
11
|
-
export type PrinterEntry = [string, number, string]
|
|
10
|
+
/** `[nozzle diameter, index into sets, model name without the nozzle suffix, default process preset]` */
|
|
11
|
+
export type PrinterEntry = [string, number, string, string]
|
|
12
12
|
|
|
13
13
|
export interface PrinterData {
|
|
14
14
|
/** Option keys, in column order — the same keys the settings panel edits */
|
package/types/data.d.ts
CHANGED
|
@@ -5,10 +5,12 @@ import type { UIPage } from './data/ui-tree.json.d.ts'
|
|
|
5
5
|
import type { ToggleGroup } from './data/toggle-rules.json.d.ts'
|
|
6
6
|
import type { InvalidationRule } from './data/invalidation-map.json.d.ts'
|
|
7
7
|
import type { PrinterData, PrinterRow, PrinterEntry } from './data/printers.json.d.ts'
|
|
8
|
+
import type { PresetKeyLists } from './data/preset-keys.json.d.ts'
|
|
8
9
|
import type { ProcessData } from './data/processes.js.d.ts'
|
|
9
10
|
import type { FilamentData, FilamentRow, FilamentEntry } from './data/filaments.js.d.ts'
|
|
10
11
|
|
|
11
12
|
export type { ConfigOption, UIPage, ToggleGroup, InvalidationRule, PrinterData, PrinterRow, PrinterEntry }
|
|
13
|
+
export type { PresetKeyLists }
|
|
12
14
|
export type { ProcessData, FilamentData, FilamentRow, FilamentEntry }
|
|
13
15
|
|
|
14
16
|
/** The 907 option definitions */
|
|
@@ -21,6 +23,8 @@ export const toggleRules: Record<string, ToggleGroup>
|
|
|
21
23
|
export const invalidationMap: Record<string, InvalidationRule[]>
|
|
22
24
|
/** Machine limits per printer, from the upstream vendor profiles */
|
|
23
25
|
export const printers: PrinterData
|
|
26
|
+
/** Which option keys belong to which preset type — read it through `presetOptionKeys()` */
|
|
27
|
+
export const presetKeys: PresetKeyLists
|
|
24
28
|
// The two large artifacts load on demand — read them through processPresets()/filamentPresets()
|
|
25
29
|
// in three-slicer/settings rather than decoding the column layout here.
|
|
26
30
|
export function loadProcesses(): Promise<ProcessData>
|
package/types/settings-keys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by types/gen_settings_types.mjs — DO NOT EDIT.
|
|
2
|
-
// Source: data/config-schema.json (
|
|
2
|
+
// Source: data/config-schema.json (976 keys)
|
|
3
3
|
|
|
4
4
|
/** [x, y] — coPoint family */
|
|
5
5
|
export type Point = [number, number]
|
|
@@ -96,6 +96,40 @@ export interface SlicerSettings {
|
|
|
96
96
|
bottom_surface_fill_order?: 'default' | 'outward' | 'inward'
|
|
97
97
|
/** Bottom surface pattern — This is the line pattern of bottom surface infill, not including bridge infill. */
|
|
98
98
|
bottom_surface_pattern?: 'monotonic' | 'monotonicline' | 'rectilinear' | 'alignedrectilinear' | 'concentric' | 'hilbertcurve' | 'archimedeanchords' | 'octagramspiral'
|
|
99
|
+
/** Support base diameter — (mm) — Diameter in mm of the pillar base */
|
|
100
|
+
branchingsupport_base_diameter?: number
|
|
101
|
+
/** Support base height — (mm) — The height of the pillar base cone */
|
|
102
|
+
branchingsupport_base_height?: number
|
|
103
|
+
/** Support base safety distance — (mm) — The minimum distance of the pillar base from the model in mm. Makes sense in zero elevation mode where a gap according to this parameter is inserted between the model and the pad. */
|
|
104
|
+
branchingsupport_base_safety_distance?: number
|
|
105
|
+
/** Support on build plate only — Only create support if it lies on a build plate. Don't create support on a print. */
|
|
106
|
+
branchingsupport_buildplate_only?: boolean
|
|
107
|
+
/** Critical angle — (°) — The default angle for connecting support sticks and junctions. */
|
|
108
|
+
branchingsupport_critical_angle?: number
|
|
109
|
+
/** Pinhead front diameter — (mm) — Diameter of the pointing side of the head */
|
|
110
|
+
branchingsupport_head_front_diameter?: number
|
|
111
|
+
/** Head penetration — (mm) — How much the pinhead has to penetrate the model surface */
|
|
112
|
+
branchingsupport_head_penetration?: number
|
|
113
|
+
/** Pinhead width — (mm) — Width from the back sphere center to the front sphere center */
|
|
114
|
+
branchingsupport_head_width?: number
|
|
115
|
+
/** Max bridge length — (mm) — The max length of a bridge */
|
|
116
|
+
branchingsupport_max_bridge_length?: number
|
|
117
|
+
/** Max bridges on a pillar — Maximum number of bridges that can be placed on a pillar. Bridges hold support point pinheads and connect to pillars as small branches. */
|
|
118
|
+
branchingsupport_max_bridges_on_pillar?: number
|
|
119
|
+
/** Max pillar linking distance — (mm) — The max distance of two pillars to get linked with each other. A zero value will prohibit pillar cascading. */
|
|
120
|
+
branchingsupport_max_pillar_link_distance?: number
|
|
121
|
+
/** Max weight on model — (mm) — Maximum weight of sub-trees that terminate on the model instead of the print bed. The weight is the sum of the lenghts of all branches emanating from the endpoint. */
|
|
122
|
+
branchingsupport_max_weight_on_model?: number
|
|
123
|
+
/** Object elevation — (mm) — How much the supports should lift up the supported object. If "Pad around object" is enabled, this value is ignored. */
|
|
124
|
+
branchingsupport_object_elevation?: number
|
|
125
|
+
/** Pillar connection mode — Controls the bridge type between two neighboring pillars. Can be zig-zag, cross (double zig-zag) or dynamic which will automatically switch between the first two depending on the distance of the two pillars. */
|
|
126
|
+
branchingsupport_pillar_connection_mode?: string
|
|
127
|
+
/** Pillar diameter — (mm) — Diameter in mm of the support pillars */
|
|
128
|
+
branchingsupport_pillar_diameter?: number
|
|
129
|
+
/** Pillar widening factor — Merging bridges or pillars into another pillars can increase the radius. Zero means no increase, one means full increase. The exact amount of increase is unspecified and can change in the future. */
|
|
130
|
+
branchingsupport_pillar_widening_factor?: number
|
|
131
|
+
/** Small pillar diameter percent — (%) — The percentage of smaller pillars compared to the normal pillar diameter which are used in problematic areas where a normal pilla cannot fit. */
|
|
132
|
+
branchingsupport_small_pillar_diameter_percent?: number
|
|
99
133
|
/** Bridge — (mm/s² or %) — Acceleration of bridges. If the value is expressed as a percentage (e.g. 50%), it will be calculated based on the outer wall acceleration. */
|
|
100
134
|
bridge_acceleration?: (number | string)[] | (number | string)
|
|
101
135
|
/** External bridge infill direction — (°) — External Bridging angle override. If left to zero, the bridging angle will be calculated automatically for each specific bridge. Otherwise the provided angle will be used according to: - The absolute coordinates - The absolute coordinates + Model rotation: If Align directions to model is enabled - The optimal automatic angle + this value: If 'Relative Bridge Angle' is enabled Use 180° for zero absolute angle. */
|
|
@@ -201,6 +235,12 @@ export interface SlicerSettings {
|
|
|
201
235
|
default_print_profile?: string
|
|
202
236
|
default_sla_material_profile?: string
|
|
203
237
|
default_sla_print_profile?: string
|
|
238
|
+
/** (s) — Delay after exposure before layer separation. */
|
|
239
|
+
delay_after_exposure?: number[] | number
|
|
240
|
+
/** (s) — Sets a fixed pause before an exposure of the new layer starts. This setting is ignored if 'Dynamic delay before exposure' is enabled. */
|
|
241
|
+
delay_before_exposure?: number[] | number
|
|
242
|
+
/** (s) — Defines the pause between the separation movement (tilt down, Z-hop) and the return movement (tilt up). Increasing this time allows the resin more time to fully reflood the peeled-off layer. */
|
|
243
|
+
delay_to_reflood?: number[] | number
|
|
204
244
|
/** Deretraction speed (extruder change) — (mm/s) — Speed for reloading filament into the nozzle when switching extruder. */
|
|
205
245
|
deretract_speed_extruder_change?: number[] | number
|
|
206
246
|
/** Deretraction speed — (mm/s) — Speed for reloading filament into the nozzle. Zero means same speed of retraction. */
|
|
@@ -235,6 +275,14 @@ export interface SlicerSettings {
|
|
|
235
275
|
draft_shield?: 'disabled' | 'enabled'
|
|
236
276
|
/** Fan speed — (%) */
|
|
237
277
|
during_print_exhaust_fan_speed?: number[] | number
|
|
278
|
+
/** Switches between predefined algorithms that influence how the dynamic delay before exposure function behaves. */
|
|
279
|
+
dynamic_delay_before_profile?: string[] | string
|
|
280
|
+
/** Sets the maximum allowed time for waiting for the pressure sensors to stabilize during dynamic delay before exposure. Once this timeout expires, the printer starts exposing the next layer regardless of resin pressure stabilization. */
|
|
281
|
+
dynamic_delay_before_timeout?: number[] | number
|
|
282
|
+
/** Switches between predefined algorithms that influence how the dynamic tilt down function behaves. */
|
|
283
|
+
dynamic_tilt_down_profile?: string[] | string
|
|
284
|
+
/** Switches between predefined algorithms that influence how the dynamic tilt up function behaves. */
|
|
285
|
+
dynamic_tilt_up_profile?: string[] | string
|
|
238
286
|
/** Absolute E position — Current position of the extruder axis. Only used with absolute extruder addressing. */
|
|
239
287
|
e_position?: number[] | number
|
|
240
288
|
/** Extra de-retraction — Currently planned extra extruder priming after de-retraction. */
|
|
@@ -651,6 +699,8 @@ export interface SlicerSettings {
|
|
|
651
699
|
help?: boolean
|
|
652
700
|
/** High extruder current on filament swap — It may be beneficial to increase the extruder motor current during the filament exchange sequence to allow for rapid ramming feed rates and to overcome resistance when loading a filament with an ugly shaped tip. */
|
|
653
701
|
high_current_on_filament_swap?: boolean
|
|
702
|
+
/** High viscosity — (s) — Time of the super slow tilt */
|
|
703
|
+
high_viscosity_tilt_time?: number
|
|
654
704
|
/** Convert holes to polyholes — Search for almost-circular holes that span more than one layer and convert the geometry to polyholes. Use the nozzle size and the (biggest) diameter to compute the polyhole. See http://hydraraptor.blogspot.com/2011/02/polyholes.html */
|
|
655
705
|
hole_to_polyhole?: boolean
|
|
656
706
|
/** Maximum Polyhole edge count — Maximum number of polyhole edges This setting limits the amount of edges a polyhole can have */
|
|
@@ -934,8 +984,12 @@ export interface SlicerSettings {
|
|
|
934
984
|
material_correction_y?: number
|
|
935
985
|
material_correction_z?: number
|
|
936
986
|
material_density?: number
|
|
987
|
+
/** SLA print material notes — You can put your notes regarding the SLA print material here. */
|
|
988
|
+
material_notes?: string
|
|
937
989
|
material_print_speed?: 'slow' | 'fast'
|
|
938
990
|
material_type?: string
|
|
991
|
+
/** Material UUID (FOR DEBUGGING ONLY) */
|
|
992
|
+
material_uuid?: string
|
|
939
993
|
material_vendor?: string
|
|
940
994
|
/** Max bridge length — (mm) — This is the maximum length of bridges that don\'t need support. Set it to 0 if you want all bridges to be supported, and set it to a very large value if you don\'t want any bridges to be supported. */
|
|
941
995
|
max_bridge_length?: number
|
|
@@ -1206,6 +1260,8 @@ export interface SlicerSettings {
|
|
|
1206
1260
|
printhost_user?: string
|
|
1207
1261
|
/** Between Object G-code — Insert G-code between objects. This parameter will only come into effect when you print your models object by object. */
|
|
1208
1262
|
printing_by_object_gcode?: string
|
|
1263
|
+
/** Printing temperature — (°C) — This value sets the target printing temperature. The printer will wait for the resin to reach this stable temperature before starting and will maintain it throughout the print. When disabled, the printer ignores the resin's current temperature and begins printing immediately. */
|
|
1264
|
+
printing_temperature?: number
|
|
1209
1265
|
/** Change extrusion role G-code (process) — This G-code is inserted when the extrusion role is changed. It runs after the machine and filament extrusion role G-code. */
|
|
1210
1266
|
process_change_extrusion_role_gcode?: string
|
|
1211
1267
|
/** Purge in prime tower — Purge remaining filament into prime tower. */
|
|
@@ -1348,7 +1404,11 @@ export interface SlicerSettings {
|
|
|
1348
1404
|
skirt_start_angle?: number
|
|
1349
1405
|
/** Skirt type — Combined - single skirt for all objects, Per object - individual object skirt. */
|
|
1350
1406
|
skirt_type?: 'combined' | 'perobject'
|
|
1407
|
+
/** Format of the output SLA archive */
|
|
1408
|
+
sla_archive_format?: string
|
|
1351
1409
|
sla_material_settings_id?: string
|
|
1410
|
+
/** it_opt->second.label — (it_opt->second.sidetext) — it_opt->second.tooltip */
|
|
1411
|
+
sla_output_precision?: number
|
|
1352
1412
|
sla_print_settings_id?: string
|
|
1353
1413
|
/** Slice — Slice the plates: 0-all plates, i-plate i, others-invalid */
|
|
1354
1414
|
slice?: number
|
|
@@ -1441,6 +1501,8 @@ export interface SlicerSettings {
|
|
|
1441
1501
|
support_critical_angle?: number
|
|
1442
1502
|
/** Support critical regions only — Only create support for critical regions including sharp tail, cantilever, etc. */
|
|
1443
1503
|
support_critical_regions_only?: boolean
|
|
1504
|
+
/** Support only in enforced regions — Only create support if it lies in a support enforcer. */
|
|
1505
|
+
support_enforcers_only?: boolean
|
|
1444
1506
|
/** Normal support expansion — (mm) — Expand (+) or shrink (-) the horizontal span of normal support. */
|
|
1445
1507
|
support_expansion?: number
|
|
1446
1508
|
/** Support fast purge mode — Whether this printer supports fast purge mode with optimized temperature and multiplier. */
|
|
@@ -1485,6 +1547,8 @@ export interface SlicerSettings {
|
|
|
1485
1547
|
support_max_bridge_length?: number
|
|
1486
1548
|
support_max_bridges_on_pillar?: number
|
|
1487
1549
|
support_max_pillar_link_distance?: number
|
|
1550
|
+
/** Max weight on model — (mm) — Maximum weight of sub-trees that terminate on the model instead of the print bed. The weight is the sum of the lenghts of all branches emanating from the endpoint. */
|
|
1551
|
+
support_max_weight_on_model?: number
|
|
1488
1552
|
/** Support multi bed types — Enable this option if you want to use multiple bed types. */
|
|
1489
1553
|
support_multi_bed_types?: boolean
|
|
1490
1554
|
support_object_elevation?: number
|
|
@@ -1516,6 +1580,8 @@ export interface SlicerSettings {
|
|
|
1516
1580
|
support_threshold_overlap?: number | string
|
|
1517
1581
|
/** Top Z distance — (mm) — Z gap between the support\'s top and object. */
|
|
1518
1582
|
support_top_z_distance?: number
|
|
1583
|
+
/** Support tree type — Support tree building strategy */
|
|
1584
|
+
support_tree_type?: string
|
|
1519
1585
|
/** Type — Normal (auto) and Tree (auto) are used to generate support automatically. If Normal (manual) or Tree (manual) is selected, only support enforcers are generated. */
|
|
1520
1586
|
support_type?: 'normal(auto)' | 'tree(auto)' | 'normal(manual)' | 'tree(manual)'
|
|
1521
1587
|
supports_enable?: boolean
|
|
@@ -1541,6 +1607,38 @@ export interface SlicerSettings {
|
|
|
1541
1607
|
thumbnails?: string
|
|
1542
1608
|
/** Format of G-code thumbnails — Format of G-code thumbnails: PNG for best quality, JPG for smallest size, QOI for low memory firmware. */
|
|
1543
1609
|
thumbnails_format?: 'PNG' | 'JPG' | 'QOI' | 'BTT_TFT' | 'COLPIC'
|
|
1610
|
+
/** Number of cycles to split the rest of the tilt down move. */
|
|
1611
|
+
tilt_down_cycles?: number[] | number
|
|
1612
|
+
/** (s) — The delay between tilt-down cycles. */
|
|
1613
|
+
tilt_down_delay?: number[] | number
|
|
1614
|
+
/** (μ-steps/s) — Sets the final speed for the tilt-down separation move. Too high a speed, especially with less viscous resins, can cause resin to splash out of the tank. */
|
|
1615
|
+
tilt_down_finish_speed?: string[] | string
|
|
1616
|
+
/** (μ-steps/s) — Tilt speed used for the rest of the tilt down move. */
|
|
1617
|
+
tilt_down_finish_speed_slx?: string[] | string
|
|
1618
|
+
/** (μ-steps/s) — Sets the initial speed for the tilt-down separation move. A high speed may negatively affect print quality or success, especially with certain resins or delicate geometries, but it speeds up the overall print time. */
|
|
1619
|
+
tilt_down_initial_speed?: string[] | string
|
|
1620
|
+
/** (μ-steps/s) — Tilt speed used for an initial portion of tilt down move. */
|
|
1621
|
+
tilt_down_initial_speed_slx?: string[] | string
|
|
1622
|
+
/** (s) — Delay after the tilt reaches 'tilt_down_offset_steps' position. */
|
|
1623
|
+
tilt_down_offset_delay?: number[] | number
|
|
1624
|
+
/** (μ-steps) — Defines the distance (steps) over which the 'Tilt down initial speed' is applied. Once this distance is covered, the tilt moves at the 'Tilt down finish speed'. Setting to 0 immediately applies the finish speed. Maximum distance varies by printer, typically around 12,000 steps. */
|
|
1625
|
+
tilt_down_offset_steps?: number[] | number
|
|
1626
|
+
/** Number of cycles to split the rest of the tilt-up. */
|
|
1627
|
+
tilt_up_cycles?: number[] | number
|
|
1628
|
+
/** (s) — The delay between tilt-up cycles. */
|
|
1629
|
+
tilt_up_delay?: number[] | number
|
|
1630
|
+
/** (μ-steps/s) — Sets the final speed for the tilt-up return movement. Excessive speed, especially with highly viscous resins, can lead to a loss of print quality, or in extreme cases, tilt motor skipping or damage to the print display. */
|
|
1631
|
+
tilt_up_finish_speed?: string[] | string
|
|
1632
|
+
/** (μ-steps/s) — Tilt speed used for the rest of the tilt-up. */
|
|
1633
|
+
tilt_up_finish_speed_slx?: string[] | string
|
|
1634
|
+
/** (μ-steps/s) — Sets the initial speed for the tilt-up return movement. */
|
|
1635
|
+
tilt_up_initial_speed?: string[] | string
|
|
1636
|
+
/** (μ-steps/s) — Tilt speed used for an initial portion of tilt up move. */
|
|
1637
|
+
tilt_up_initial_speed_slx?: string[] | string
|
|
1638
|
+
/** (s) — Delay after the tilt reaches 'tilt_up_offset_steps' position. */
|
|
1639
|
+
tilt_up_offset_delay?: number[] | number
|
|
1640
|
+
/** (μ-steps) — Defines the distance over which the 'Tilt up initial speed' is applied. After this distance, the tilt moves at the 'Tilt up finish speed'. Setting to 0 immediately applies the finish speed. */
|
|
1641
|
+
tilt_up_offset_steps?: number[] | number
|
|
1544
1642
|
/** Time cost — (money/h) — The printer cost per hour. */
|
|
1545
1643
|
time_cost?: number
|
|
1546
1644
|
/** Timelapse G-code */
|
|
@@ -1597,6 +1695,10 @@ export interface SlicerSettings {
|
|
|
1597
1695
|
total_wipe_tower_cost?: number
|
|
1598
1696
|
/** Wipe tower volume — Total filament volume extruded on the wipe tower. */
|
|
1599
1697
|
total_wipe_tower_filament?: number
|
|
1698
|
+
/** (mm) — An alternative separation move to tilting. After layer exposure, the platform lifts by this distance. A minimum of 5mm is recommended if tilting is disabled. If you use tilting, we suggest 0mm, although a combination of both is possible. */
|
|
1699
|
+
tower_hop_height?: number[] | number
|
|
1700
|
+
/** (mm/s) — Tower speed used for tower raise. */
|
|
1701
|
+
tower_speed?: string[] | string
|
|
1600
1702
|
/** Travel — (mm/s²) — Acceleration of travel moves. */
|
|
1601
1703
|
travel_acceleration?: number[] | number
|
|
1602
1704
|
/** Travel — (mm/s) — Jerk for travel. */
|
|
@@ -1649,6 +1751,8 @@ export interface SlicerSettings {
|
|
|
1649
1751
|
use_firmware_retraction?: boolean
|
|
1650
1752
|
/** Use relative E distances — Relative extrusion is recommended when using "label_objects" option. Some extruders work better with this option unchecked (absolute extrusion mode). Wipe tower is only compatible with relative mode. It is recommended on most printers. Default is checked. */
|
|
1651
1753
|
use_relative_e_distances?: boolean
|
|
1754
|
+
/** Enables or disables the tilting function. If disabled, the layer separation is performed using the 'Tower hop height' parameter. */
|
|
1755
|
+
use_tilt?: boolean[] | boolean
|
|
1652
1756
|
/** Used filament — Total length of filament used in the print. */
|
|
1653
1757
|
used_filament?: number
|
|
1654
1758
|
/** Filament length (meters) — Total filament length used in meters. Replaced with actual value during post-processing. */
|
|
@@ -1741,6 +1845,8 @@ export interface SlicerSettings {
|
|
|
1741
1845
|
zaa_min_z?: number
|
|
1742
1846
|
/** Minimize wall height angle — (°) — Reduce the height of top-surface perimeters to match the model edge height. Affects perimeters with a slope less than this angle (degrees). A reasonable value is 35. Set to 0 to disable. */
|
|
1743
1847
|
zaa_minimize_perimeter_height?: number
|
|
1848
|
+
/** Z compensation — Number of layers to Z correct to avoid cross layer bleed */
|
|
1849
|
+
zcorrection_layers?: number
|
|
1744
1850
|
/** Current Z-hop — Contains Z-hop present at the beginning of the custom G-code block. */
|
|
1745
1851
|
zhop?: number
|
|
1746
1852
|
}
|