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.
Files changed (39) hide show
  1. package/components/dist/SettingsPanel.js +112 -112
  2. package/components/styles.css +9 -9
  3. package/data/config-schema.json +999 -900
  4. package/data/invalidation-map.json +6 -5
  5. package/data/printers.json +1 -0
  6. package/data/processes.js +2 -0
  7. package/data/toggle-rules.json +44 -44
  8. package/data/ui-tree.json +170 -494
  9. package/engine/examples/headless.mjs +2 -2
  10. package/engine/index.js +2 -2
  11. package/engine/src/data.js +13 -7
  12. package/engine/src/settings.js +120 -35
  13. package/engine/src/slicer.worker.js +23 -21
  14. package/engine/src/slicer_core.js +0 -0
  15. package/engine/src/slicer_core.mt.js +0 -0
  16. package/engine/src/toggle_eval.js +11 -11
  17. package/package.json +4 -2
  18. package/types/components.d.ts +5 -5
  19. package/types/data/config-schema.json.d.ts +6 -6
  20. package/types/data/invalidation-map.json.d.ts +5 -5
  21. package/types/data/printers.json.d.ts +23 -0
  22. package/types/data/processes.js.d.ts +21 -0
  23. package/types/data/toggle-rules.json.d.ts +5 -5
  24. package/types/data/ui-tree.json.d.ts +3 -3
  25. package/types/data.d.ts +10 -7
  26. package/types/gen_settings_types.mjs +10 -10
  27. package/types/settings-keys.d.ts +18 -7
  28. package/types/settings.d.ts +6 -6
  29. package/types/toggle.d.ts +6 -6
  30. package/types/viewer-loaders.d.ts +8 -8
  31. package/types/viewer-toolpath.d.ts +17 -17
  32. package/types/viewer.d.ts +3 -3
  33. package/types/wasm.d.ts +3 -3
  34. package/types/worker.d.ts +2 -2
  35. package/viewer/dist/Viewport.js +1760 -966
  36. package/viewer/dist/make_worker.js +6 -6
  37. package/viewer/dist/model_loaders.js +35 -35
  38. package/viewer/dist/toolpath_gpu.js +146 -147
  39. package/viewer/styles.css +46 -25
package/viewer/styles.css CHANGED
@@ -1,14 +1,14 @@
1
- /* Shadow DOM 격리(shadow_host.jsx) — 이 파일은 ?inline 으로 번들에 문자열로 내장돼
2
- shadow root 에 주입된다. 외부 리셋(*{box-sizing} 등)이 닿지 않으므로 여기서 명시한다. */
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단계: 버튼이 늘어남. flex-wrap 은 절대배치 박스의 shrink-to-fit 폭을 붕괴시켜(실측 848→424px)
44
- 내용이 다 들어가는데도 2줄로 접힌다. 한 줄을 유지하고, 좁은 뷰포트에서만 가로 스크롤로 흘린다. */
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단계-2: 플레이트 탭바 + 슬라이스 드롭다운 */
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 좌하단 stats 카드 */
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
- /* 임베드된 SettingsPanel 의 폭·테두리 오버라이드는 이제 패널 자신의 shadow 안 규칙
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단계 S6: 뷰 타입 셀렉트 · 이중 슬라이더 · 그라디언트 범례 */
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
- /* 멀티 오브젝트 목록 / 서포트 토글 (3단계) */
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; }