three-slicer 0.1.1 → 0.1.3
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/components/dist/SettingsPanel.js +112 -112
- package/components/styles.css +9 -9
- package/data/config-schema.json +999 -900
- package/data/invalidation-map.json +6 -5
- package/data/printers.json +1 -0
- package/data/processes.js +2 -0
- package/data/toggle-rules.json +44 -44
- package/data/ui-tree.json +170 -494
- package/engine/examples/headless.mjs +2 -2
- package/engine/index.js +2 -2
- package/engine/src/data.js +13 -7
- package/engine/src/settings.js +120 -35
- package/engine/src/slicer.worker.js +23 -21
- package/engine/src/slicer_core.js +0 -0
- package/engine/src/slicer_core.mt.js +0 -0
- package/engine/src/toggle_eval.js +11 -11
- package/package.json +4 -2
- package/types/components.d.ts +5 -5
- package/types/data/config-schema.json.d.ts +6 -6
- package/types/data/invalidation-map.json.d.ts +5 -5
- package/types/data/printers.json.d.ts +23 -0
- package/types/data/processes.js.d.ts +21 -0
- package/types/data/toggle-rules.json.d.ts +5 -5
- package/types/data/ui-tree.json.d.ts +3 -3
- package/types/data.d.ts +10 -7
- package/types/gen_settings_types.mjs +10 -10
- package/types/settings-keys.d.ts +18 -7
- package/types/settings.d.ts +6 -6
- package/types/toggle.d.ts +6 -6
- package/types/viewer-loaders.d.ts +8 -8
- package/types/viewer-toolpath.d.ts +17 -17
- package/types/viewer.d.ts +3 -3
- package/types/wasm.d.ts +3 -3
- package/types/worker.d.ts +2 -2
- package/viewer/dist/Viewport.js +1760 -966
- package/viewer/dist/make_worker.js +6 -6
- package/viewer/dist/model_loaders.js +35 -35
- package/viewer/dist/toolpath_gpu.js +146 -147
- package/viewer/styles.css +46 -25
package/viewer/styles.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/* Shadow DOM
|
|
2
|
-
shadow root
|
|
1
|
+
/* Shadow DOM isolation (shadow_host.jsx) — this file is inlined into the bundle as a string via ?inline
|
|
2
|
+
and injected into the shadow root. Outside resets (*{box-sizing}, …) cannot reach it, so they are spelled out here. */
|
|
3
3
|
:host { display: contents; }
|
|
4
4
|
* { box-sizing: border-box; }
|
|
5
5
|
|
|
6
|
-
/* ===== 27
|
|
6
|
+
/* ===== Stage 27: desktop-style shell (top bar · left rail · center viewport · right sidebar) ===== */
|
|
7
7
|
.app-shell { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0e1216; color: #cdd6dd;
|
|
8
8
|
font: 14px/1.5 -apple-system, "Segoe UI", sans-serif; }
|
|
9
9
|
.app-body { flex: 1 1 auto; display: flex; min-height: 0; }
|
|
10
10
|
|
|
11
|
-
/* S1
|
|
11
|
+
/* S1 top bar */
|
|
12
12
|
.topbar { flex: 0 0 44px; height: 44px; display: flex; align-items: center; padding: 0 12px; gap: 10px;
|
|
13
13
|
background: #161b21; border-bottom: 1px solid #262d35; }
|
|
14
14
|
.topbar .tb-left, .topbar .tb-right { flex: 1 1 0; display: flex; align-items: center; gap: 8px; }
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.tb-tabs button:disabled { color: #5a6570; cursor: not-allowed; }
|
|
26
26
|
.tb-icon { width: 28px; height: 28px; border: 1px solid #2c353d; background: #20272f; color: #7d8b96; border-radius: 6px; font-size: 15px; cursor: not-allowed; }
|
|
27
27
|
|
|
28
|
-
/* S3
|
|
28
|
+
/* S3 left gizmo rail */
|
|
29
29
|
.left-rail { flex: 0 0 48px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 0;
|
|
30
30
|
background: #12171c; border-right: 1px solid #232a31; }
|
|
31
31
|
.left-rail button { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent;
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
.left-rail button.on img { opacity: 1; filter: brightness(1.6); }
|
|
37
37
|
.rail-sep { width: 26px; height: 1px; background: #2a323a; margin: 3px 0; }
|
|
38
38
|
|
|
39
|
-
/*
|
|
39
|
+
/* Center viewport column */
|
|
40
40
|
.viewport-col { position: relative; flex: 1 1 auto; min-width: 0; background: #161a1e; }
|
|
41
41
|
.vp-top-toolbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center;
|
|
42
42
|
gap: 3px; background: rgba(18,23,28,.85); padding: 4px; border-radius: 9px; border: 1px solid #2a323a; z-index: 3;
|
|
43
|
-
/* 33
|
|
44
|
-
|
|
43
|
+
/* Stage 33: more buttons. flex-wrap collapses the shrink-to-fit width of an absolutely positioned box (measured 848 -> 424px),
|
|
44
|
+
folding into two rows even when everything fits. Keep one row and let narrow viewports scroll horizontally instead. */
|
|
45
45
|
max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
|
|
46
46
|
.vp-top-toolbar::-webkit-scrollbar { display: none; }
|
|
47
47
|
.vp-top-toolbar > * { flex: 0 0 auto; }
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
.vp-top-toolbar button:disabled { opacity: .32; cursor: not-allowed; }
|
|
53
53
|
.vtt-sep { width: 1px; align-self: stretch; background: #333c45; margin: 3px 3px; }
|
|
54
54
|
|
|
55
|
-
/* 29
|
|
55
|
+
/* Stage 29-2: plate tab bar + slice dropdown */
|
|
56
56
|
.plate-bar { position: absolute; right: 14px; bottom: 30px; display: flex; align-items: center; gap: 4px; z-index: 3;
|
|
57
57
|
background: rgba(18,23,28,.85); border: 1px solid #2a323a; border-radius: 9px; padding: 4px; }
|
|
58
58
|
.plate-bar button { min-width: 26px; height: 26px; border: 1px solid #2c353d; background: #1a2027; color: #9fb3c0;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
color: #24282e; cursor: pointer; font-size: 13px; }
|
|
69
69
|
.slice-menu button:hover { background: #eef7f1; }
|
|
70
70
|
|
|
71
|
-
/*
|
|
71
|
+
/* Floating painting panel */
|
|
72
72
|
.brush-panel { position: absolute; top: 58px; left: 14px; width: 214px; background: rgba(22,27,33,.95);
|
|
73
73
|
border: 1px solid #2c353d; border-radius: 10px; padding: 10px; z-index: 4; box-shadow: 0 3px 14px rgba(0,0,0,.45); }
|
|
74
74
|
.bp-title { font-weight: 600; margin-bottom: 6px; color: #cdd6dd; }
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
.bp-radius input { width: 100%; }
|
|
81
81
|
.bp-counts { margin-top: 6px; font-size: 11px; }
|
|
82
82
|
|
|
83
|
-
/* Preview
|
|
83
|
+
/* Preview stats card, bottom left */
|
|
84
84
|
.stats-card { position: absolute; left: 14px; bottom: 32px; background: rgba(22,27,33,.93); border: 1px solid #2c353d;
|
|
85
85
|
border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.7; z-index: 2; color: #cdd6dd; }
|
|
86
86
|
.stats-card b { color: #9fe3bd; }
|
|
87
87
|
|
|
88
|
-
/* S4
|
|
88
|
+
/* S4 right sidebar (light) */
|
|
89
89
|
.sidebar { flex: 0 0 384px; width: 384px; display: flex; flex-direction: column; background: #eef0f2; color: #24282e;
|
|
90
90
|
border-left: 1px solid #d5d8dd; min-height: 0; }
|
|
91
91
|
.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
.obj-del { border: 0; background: #fbe9ec; color: #d0435a; border-radius: 5px; cursor: pointer; padding: 0 6px; }
|
|
115
115
|
.side-card .slice-support { color: #444; font-size: 12px; margin: 5px 0 0; }
|
|
116
116
|
|
|
117
|
-
/*
|
|
117
|
+
/* Process card = embedded settings panel (light, full width) */
|
|
118
118
|
.process-card { padding: 8px; }
|
|
119
|
-
/*
|
|
120
|
-
(:host(.sp-embedded), components/styles.css) —
|
|
119
|
+
/* Width/border overrides for the embedded SettingsPanel now live in the panel's own shadow rules
|
|
120
|
+
(:host(.sp-embedded), components/styles.css) — they are across the boundary and unreachable from here. */
|
|
121
121
|
|
|
122
|
-
/* Preview
|
|
122
|
+
/* Preview control overrides (inside the light card) */
|
|
123
123
|
.side-card .view-type-row { color: #444; }
|
|
124
124
|
.side-card .view-type-row select, .side-card .obj-ext { background: #fff; color: #222; border: 1px solid #ccd0d5; }
|
|
125
125
|
.side-card .slice-layer label { color: #444; font-size: 12px; }
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
.side-card .layer-ctl button { background: #f1f2f4; color: #333; border: 1px solid #d3d6db; }
|
|
129
129
|
.side-card .layer-ctl button.on { background: #00ae42; color: #fff; border-color: #00ae42; }
|
|
130
130
|
|
|
131
|
-
/*
|
|
131
|
+
/* (5) Fixed bottom button bar */
|
|
132
132
|
.side-bottom { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px; border-top: 1px solid #dcdfe3; background: #e6e9ec; }
|
|
133
133
|
.side-bottom .slice-btn { flex: 1.4; margin: 0; }
|
|
134
134
|
.auto-slice { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #444; cursor: pointer; white-space: nowrap; user-select: none; }
|
|
@@ -145,8 +145,29 @@
|
|
|
145
145
|
.vp-status { position: absolute; bottom: 8px; left: 12px; right: 12px; z-index: 1;
|
|
146
146
|
font-size: 11.5px; color: #9fe3bd; font-family: ui-monospace, monospace;
|
|
147
147
|
text-shadow: 0 1px 2px #000; pointer-events: none; }
|
|
148
|
-
/* ---- Slice
|
|
148
|
+
/* ---- Slice status display (viewport overlay) ---- */
|
|
149
149
|
.slice-warn { color: #f0c060; margin: 4px 0; }
|
|
150
|
+
/* Basis line under the print-time estimate — the machine limits the kernel reported using */
|
|
151
|
+
.sc-sub { font-size: 10.5px; opacity: .62; margin: 1px 0 3px; }
|
|
152
|
+
/* Collapsible card section holding an injected settings page (printer motion ability) */
|
|
153
|
+
.sc-fold > summary { display: flex; justify-content: space-between; align-items: center; font-size: 12px;
|
|
154
|
+
color: #5a6069; padding: 2px 0; cursor: pointer; list-style: none; }
|
|
155
|
+
.sc-fold > summary::-webkit-details-marker { display: none; }
|
|
156
|
+
.sc-fold-lbl::before { content: '▸'; display: inline-block; width: 10px; font-size: 9px; opacity: .5; }
|
|
157
|
+
.sc-fold[open] .sc-fold-lbl::before { content: '▾'; }
|
|
158
|
+
.sc-fold > summary b { color: #24282e; }
|
|
159
|
+
.sc-fold[open] > summary { border-bottom: 1px solid #e3e6ea; margin-bottom: 4px; }
|
|
160
|
+
/* The injected page is a full settings form — keep it from stretching the card unboundedly */
|
|
161
|
+
.sc-fold-body { max-height: 320px; overflow-y: auto; }
|
|
162
|
+
.sc-model { max-width: 62%; font-size: 11.5px; padding: 1px 2px; }
|
|
163
|
+
/* Support helpers grouped under the "Generate support" toggle */
|
|
164
|
+
.support-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
165
|
+
margin: 2px 0 2px 16px; padding-left: 6px; border-left: 2px solid #e3e6ea; }
|
|
166
|
+
.sup-style { margin-left: 16px; padding-left: 6px; border-left: 2px solid #e3e6ea; }
|
|
167
|
+
.sup-paint { font-size: 11px; padding: 2px 8px; border: 1px solid #c9ced6; border-radius: 5px;
|
|
168
|
+
background: #fff; color: #24282e; cursor: pointer; white-space: nowrap; }
|
|
169
|
+
.sup-paint.on { background: #2b6cff; border-color: #2b6cff; color: #fff; }
|
|
170
|
+
.sup-paint:disabled { opacity: .45; cursor: not-allowed; }
|
|
150
171
|
.slice-btn { width: 100%; margin-top: 6px; padding: 7px; border: 0; border-radius: 7px;
|
|
151
172
|
background: #00ae42; color: #fff; font-weight: 700; cursor: pointer; }
|
|
152
173
|
.slice-btn:disabled { background: #3a4650; color: #8b98a2; cursor: not-allowed; }
|
|
@@ -157,7 +178,7 @@
|
|
|
157
178
|
.slice-layer input[type=range] { width: 100%; }
|
|
158
179
|
.slice-travel { color: #aebcc6; display: flex; align-items: center; gap: 4px; }
|
|
159
180
|
|
|
160
|
-
/* 25
|
|
181
|
+
/* Stage 25 S6: view type select · dual slider · gradient legend */
|
|
161
182
|
.view-type-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #aebcc6; }
|
|
162
183
|
.view-type-row select { flex: 1; background: #10141a; color: #eee; border: 1px solid #2c353d; border-radius: 4px; padding: 2px 4px; }
|
|
163
184
|
.dual-slider { position: relative; height: 22px; }
|
|
@@ -178,7 +199,7 @@
|
|
|
178
199
|
.role-item i { width: 10px; height: 6px; border-radius: 2px; display: inline-block; }
|
|
179
200
|
.role-item b { color: #cdd6dd; }
|
|
180
201
|
|
|
181
|
-
/* 26
|
|
202
|
+
/* Stage 26: empty scene hint + drag-and-drop overlay */
|
|
182
203
|
.vp-canvas.drag-over { outline: 3px dashed #00ae42; outline-offset: -6px; }
|
|
183
204
|
.empty-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
184
205
|
gap: 8px; pointer-events: none; color: #9fb3c0; text-align: center; }
|
|
@@ -192,12 +213,12 @@
|
|
|
192
213
|
background: rgba(0,174,66,.14); color: #d7f7e3; font-size: 18px; font-weight: 700; pointer-events: none;
|
|
193
214
|
border: 3px dashed #00ae42; box-sizing: border-box; }
|
|
194
215
|
|
|
195
|
-
/*
|
|
216
|
+
/* Split objects button */
|
|
196
217
|
.obj-split { border: 0; background: transparent; cursor: pointer; padding: 0 3px; line-height: 0; }
|
|
197
218
|
.obj-split img { width: 13px; height: 13px; opacity: .6; }
|
|
198
219
|
.obj-split:hover img { opacity: 1; }
|
|
199
220
|
|
|
200
|
-
/*
|
|
221
|
+
/* Right-click context menu */
|
|
201
222
|
.ctx-scrim { position: absolute; inset: 0; z-index: 24; }
|
|
202
223
|
.ctx-menu { position: absolute; z-index: 25; min-width: 168px; padding: 4px;
|
|
203
224
|
background: #1b2027; border: 1px solid #2f3944; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
|
|
@@ -210,7 +231,7 @@
|
|
|
210
231
|
.ctx-menu hr { margin: 4px 6px; border: 0; border-top: 1px solid #2f3944; }
|
|
211
232
|
.ctx-key { color: #7d8b96; font-family: ui-monospace, monospace; font-size: 11px; }
|
|
212
233
|
|
|
213
|
-
/*
|
|
234
|
+
/* Keyboard shortcut help overlay ('?') */
|
|
214
235
|
.help-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
|
|
215
236
|
background: rgba(8,12,16,.72); z-index: 20; }
|
|
216
237
|
.help-card { background: #1b2027; color: #dfe6ee; border: 1px solid #2f3944; border-radius: 10px;
|
|
@@ -222,12 +243,12 @@
|
|
|
222
243
|
.help-card dt { color: #9fb0c2; font-family: ui-monospace, monospace; white-space: nowrap; }
|
|
223
244
|
.help-card dd { margin: 0; }
|
|
224
245
|
|
|
225
|
-
/*
|
|
246
|
+
/* Multi-object list / support toggle (stage 3) */
|
|
226
247
|
.slice-support { display: flex; align-items: center; gap: 5px; margin: 6px 0; color: #cdd6dd; font-size: 12px; }
|
|
227
248
|
|
|
228
249
|
.slice-support .muted { font-size: 10px; }
|
|
229
250
|
|
|
230
|
-
/*
|
|
251
|
+
/* Printer card — inline editing of bed width x depth */
|
|
231
252
|
.sc-bed { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #222; }
|
|
232
253
|
.sc-bed input { width: 54px; padding: 1px 4px; font-size: 12px; font-weight: 600; text-align: right;
|
|
233
254
|
border: 1px solid #ccd0d5; border-radius: 5px; background: #fff; color: #222; }
|