Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1860 lines (1736 loc) · 131 KB
/
Copy pathindex.html
File metadata and controls
1860 lines (1736 loc) · 131 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--
Copyright (c) 2026 CNCKitchen (Stefan Hermann) and contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<html lang="en" data-lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BumpMesh_Color by @Mithril_MEX</title>
<meta name="description" content="BumpMesh_Color is a browser-based tool for adding displacement textures and multi-color print assignments to 3D meshes locally. Forked from BumpMesh by Stefan Hermann (CNC Kitchen)." />
<link rel="canonical" href="https://github.com/Mithril-3d/BumpMesh_Color" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="BumpMesh_Color" />
<meta property="og:title" content="BumpMesh_Color by @Mithril_MEX" />
<meta property="og:description" content="Add displacement textures and multi-color tool assignments to 3D models directly in your browser. Preview, mask, and export printable meshes locally." />
<meta property="og:url" content="https://github.com/Mithril-3d/BumpMesh_Color" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="BumpMesh_Color by @Mithril_MEX" />
<meta name="twitter:description" content="Add displacement textures and multi-color tool assignments to 3D models directly in your browser. Preview, mask, and export printable meshes locally." />
<link rel="icon" type="image/png" href="logo.png" />
<link rel="stylesheet" href="style.css?v=20261128_01" />
<script>
// Apply saved theme before first paint to avoid flash
(function() {
const t = localStorage.getItem('stlt-theme');
// If user never picked a theme, respect their OS preference
const prefersDark = t ? t === 'dark'
: window.matchMedia('(prefers-color-scheme: dark)').matches;
if (!prefersDark) document.documentElement.setAttribute('data-theme', 'light');
})();
</script>
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/",
"fflate": "https://cdn.jsdelivr.net/npm/fflate@0.8.2/esm/browser.js"
}
}
</script>
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js">
<style>
/* Sticky Export Footer & Panel Layout Guarantee */
#settings-panel {
display: flex !important;
flex-direction: column !important;
height: 100% !important;
overflow: hidden !important;
}
.settings-scroll-content {
flex: 1 1 0 !important;
min-height: 0 !important;
overflow-y: auto !important;
overflow-x: hidden !important;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.settings-scroll-content::-webkit-scrollbar { width: 5px; }
.settings-scroll-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.export-sticky-footer {
flex-shrink: 0 !important;
padding: 12px 16px !important;
background: var(--surface) !important;
border-top: 1px solid var(--border) !important;
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35) !important;
display: flex !important;
flex-direction: column !important;
gap: 8px !important;
z-index: 100 !important;
}
[data-theme="light"] .export-sticky-footer {
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1) !important;
}
.export-sticky-footer .export-buttons {
display: flex !important;
flex-wrap: wrap !important;
gap: 8px !important;
}
.export-sticky-footer .export-buttons #export-btn,
.export-sticky-footer .export-buttons #export-3mf-btn {
flex: 1 1 calc(50% - 4px) !important;
width: auto !important;
min-width: 0 !important;
}
.export-sticky-footer .export-buttons #export-multicolor-3mf-btn {
flex: 1 1 100% !important;
width: 100% !important;
}
</style>
</head>
<body>
<header>
<div class="logo">
<img src="logo.png" alt="BumpMesh_Color" width="28" height="28" />
<div class="logo-text">
<div class="logo-title">
<span>BumpMesh_Color</span>
<span id="app-version" class="app-version">v2.1.1</span>
</div>
<div class="logo-subtitle">
by <a href="https://x.com/Mithril_MEX" target="_blank" rel="noopener noreferrer">@Mithril_MEX</a>
<span class="logo-sep">·</span>
forked from <a href="https://bumpmesh.com" target="_blank" rel="noopener noreferrer" title="Original BumpMesh by Stefan Hermann (CNC Kitchen)">CNC Kitchen's BumpMesh</a>
</div>
</div>
</div>
<div class="header-actions">
<div class="project-io">
<button id="undo-btn" class="icon-btn" data-i18n-title="header.undo" title="Undo (Ctrl+Z)" disabled>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"/></svg>
</button>
<button id="redo-btn" class="icon-btn" data-i18n-title="header.redo" title="Redo (Ctrl+Shift+Z)" disabled>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 14 5-5-5-5"/><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5v0A5.5 5.5 0 0 0 9.5 20H13"/></svg>
</button>
<span class="project-io-gap" aria-hidden="true"></span>
<button id="reset-settings-btn" class="icon-btn" data-i18n-title="header.resetSettings" title="Reset settings to defaults">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 3-6.7"/><polyline points="3 3 3 9 9 9"/></svg>
</button>
<span class="project-io-gap" aria-hidden="true"></span>
<button id="export-project-btn" class="icon-btn text-btn" data-i18n-title="header.exportProject" title="Save project (.bumpmesh)">
<span data-i18n="header.save">Save</span>
</button>
<input type="file" id="import-project-input" accept=".bumpmesh" hidden />
<label for="import-project-input" class="icon-btn text-btn" data-i18n-title="header.importProject" title="Load project (.bumpmesh)" role="button" tabindex="0">
<span data-i18n="header.load">Load</span>
</label>
<div id="load-dialog" class="export-dialog hidden">
<p class="export-dialog-title" data-i18n="header.loadDialogTitle">This project includes a model. Load:</p>
<label><input type="radio" name="load-mode" id="load-mode-all" value="all" /> <span data-i18n="header.loadModelLabel">Model + settings</span></label>
<label><input type="radio" name="load-mode" id="load-mode-settings" value="settings" /> <span data-i18n="header.loadSettingsLabel">Settings only</span></label>
<button id="load-go-btn" class="export-go-btn" data-i18n="header.loadGo">Load</button>
</div>
<div id="export-dialog" class="export-dialog hidden">
<label><input type="checkbox" id="export-settings-chk" checked disabled /> <span data-i18n="header.exportSettingsLabel">Settings</span></label>
<label><input type="checkbox" id="export-model-chk" checked /> <span data-i18n="header.exportModelLabel">Model (STL)</span></label>
<label id="export-texture-row" class="hidden"><input type="checkbox" id="export-texture-chk" checked /> <span data-i18n="header.exportTextureLabel">Custom texture</span></label>
<button id="export-go-btn" class="export-go-btn" data-i18n="header.exportGo">Save</button>
</div>
</div>
<div class="lang-seg">
</div>
<button id="theme-toggle" class="theme-toggle"
data-i18n-title="theme.toggleTitle"
data-i18n-aria-label="theme.toggleAriaLabel"
title="Toggle light / dark mode" aria-label="Toggle light/dark mode">
<span class="icon-moon" data-i18n="theme.dark">Dark Theme</span>
<span class="icon-sun" data-i18n="theme.light">Light Theme</span>
</button>
<a href="https://github.com/Mithril-3d/BumpMesh_Color" target="_blank" rel="noopener noreferrer" class="github-link" title="GitHub Repository" aria-label="GitHub Repository">
<svg width="20" height="20" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>
</a>
</div>
</header>
<main>
<!-- ─── 3-D Viewport ─────────────────────────────────────────── -->
<section id="viewport-section">
<div id="drop-zone" class="drop-zone">
<div id="drop-hint" class="drop-hint">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2L2 7L12 12L22 7L12 2Z" stroke="#555" stroke-width="1.2" stroke-linejoin="round"/>
<path d="M2 17L12 22L22 17" stroke="#555" stroke-width="1.2" stroke-linejoin="round"/>
<path d="M2 12L12 17L22 12" stroke="#555" stroke-width="1.2" stroke-linejoin="round"/>
</svg>
<p data-i18n-html="dropHint.text">Drop an <strong>.stl</strong>, <strong>.obj</strong>, <strong>.3mf</strong>, <strong>.step</strong> or <strong>.zip</strong> file here<br/>or <label for="stl-file-input" class="link-label">click to browse</label></p>
<input type="file" id="stl-file-input" accept=".stl,.obj,.3mf,.step,.stp,.zip" hidden />
</div>
<canvas id="viewport" role="img" aria-label="3D model preview"></canvas>
<div id="brush-cursor"></div>
<div id="mesh-diagnostics" class="mesh-diagnostics hidden">
<button id="mesh-diag-dismiss" class="mesh-diag-dismiss" aria-label="Dismiss">×</button>
<div id="mesh-diag-fast" class="mesh-diag-results"></div>
<div class="mesh-diag-advanced-row">
<button id="mesh-diag-run-btn" class="mesh-diag-run-btn"
data-i18n="diag.runAdvanced" data-i18n-title="diag.runAdvancedTitle"
title="Check for intersecting and overlapping triangles (may take a moment on large meshes)">Run Advanced Checks</button>
<span id="mesh-diag-spinner" class="mesh-diag-spinner hidden"></span>
</div>
<div id="mesh-diag-advanced" class="mesh-diag-results hidden"></div>
</div>
<div id="cylinder-panel" class="cylinder-panel hidden"
data-i18n-aria-label="ui.cylinderPanelAria"
aria-label="Cylinder axis placement">
<canvas id="cylinder-canvas" width="240" height="240"></canvas>
<div class="cylinder-panel-label">
<span data-i18n="ui.cylinderPanelLabel">Define cylinder projection</span>
<button id="cylinder-panel-minimize" class="cylinder-panel-minimize"
type="button"
data-i18n-title="ui.cylinderPanelMinimize"
data-i18n-aria-label="ui.cylinderPanelMinimize"
title="Minimize" aria-label="Minimize">
<svg class="icon-minimize" width="10" height="10" viewBox="0 0 24 24" fill="none"><path d="M5 12h14" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
<svg class="icon-expand" width="10" height="10" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
</button>
</div>
</div>
<!-- store-cta removed for custom build -->
</div>
<div id="viewport-footer">
<span id="mesh-info" class="mesh-info"></span>
<div id="model-scale-controls" class="model-scale-controls" title="Model scale (%)" data-i18n-title="ui.modelScaleTitle">
<span class="scale-label" data-i18n="ui.modelScale">Scale:</span>
<button type="button" id="model-scale-lock-btn" class="model-scale-lock-btn active" title="Uniform scaling (keep aspect ratio)" data-i18n-title="ui.uniformScaleOn" aria-label="Uniform scaling">
<svg class="lock-icon locked" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
<svg class="lock-icon unlocked" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 9.9-1"></path>
</svg>
</button>
<div class="scale-axis-item scale-axis-x">
<label for="model-scale-x">X</label>
<input type="number" id="model-scale-x" class="scale-val-input" value="100" min="0.001" step="any" />
<span class="scale-unit">%</span>
</div>
<div class="scale-axis-item scale-axis-y">
<label for="model-scale-y">Y</label>
<input type="number" id="model-scale-y" class="scale-val-input" value="100" min="0.001" step="any" />
<span class="scale-unit">%</span>
</div>
<div class="scale-axis-item scale-axis-z">
<label for="model-scale-z">Z</label>
<input type="number" id="model-scale-z" class="scale-val-input" value="100" min="0.001" step="any" />
<span class="scale-unit">%</span>
</div>
<button type="button" id="model-scale-fit-btn" class="model-scale-btn" title="Fit Camera to Model" data-i18n-title="ui.fitCamera" aria-label="Fit Camera">
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/>
</svg>
</button>
<button type="button" id="model-scale-reset-btn" class="model-scale-btn" title="Reset Scale to 100%" data-i18n-title="ui.scaleReset">100%</button>
</div>
<label class="wireframe-toggle">
<input type="checkbox" id="wireframe-toggle" />
<span data-i18n="ui.wireframe">Wireframe</span>
</label>
<label class="wireframe-toggle">
<input type="checkbox" id="projection-toggle" />
<span data-i18n="ui.perspective">Perspective View</span>
</label>
<div class="viewport-controls-hint" data-i18n="ui.controlsHint">Left drag: orbit · Right drag: pan · Scroll: zoom</div>
</div>
</section>
<!-- ─── Settings Panel ───────────────────────────────────────── -->
<!-- Collapse tab on the sidebar's edge (js/sidebarToggle.js); hides the settings panel or gallery so the viewport gets the room -->
<button id="sidebar-toggle" class="sidebar-toggle" type="button" aria-expanded="true" aria-controls="settings-panel gallery-panel"
data-i18n-aria-label="ui.toggleSidebar" aria-label="Show or hide the sidebar"
data-i18n-title="ui.toggleSidebar" title="Show or hide the sidebar">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>
</button>
<aside id="settings-panel">
<div class="settings-scroll-content">
<!-- Model Load & Presets -->
<section class="panel-section">
<div class="model-presets-row">
<div class="model-presets-header">
<span class="model-presets-label" id="model-presets-title" data-i18n="ui.presetModels" title="Double click for secret Auto-fit Mode">Preset Models</span>
<button type="button" id="secret-mode-trigger" class="secret-mode-trigger" title="Experimental Auto-fit Mode" aria-label="Experimental Auto-fit Mode">✦</button>
</div>
<!-- Mode switcher (visible when unlocked) -->
<div id="model-mode-tabs" class="model-mode-tabs hidden">
<button type="button" class="model-mode-tab active" data-mode="preset" data-i18n="ui.modeStandard">Standard</button>
<button type="button" class="model-mode-tab" data-mode="autofit" data-i18n="ui.modeAutoFit">Auto-fit (Image)</button>
</div>
<!-- Standard Preset Buttons -->
<div id="standard-preset-btns" class="model-preset-btns">
<button type="button" id="preset-model-cube" class="model-preset-btn active" data-preset="cube" title="Cube (50×50×50 mm)">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
<span data-i18n="ui.presetCube">Cube</span>
</button>
<button type="button" id="preset-model-cylinder" class="model-preset-btn" data-preset="cylinder" title="Cylinder (Ø80 × 100 mm)">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"/></svg>
<span data-i18n="ui.presetCylinder">Cylinder</span>
</button>
<button type="button" id="preset-model-bowl" class="model-preset-btn" data-preset="bowl" title="Bowl (Ø80 × 45 mm)">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 9c0 7.18 4.48 13 10 13s10-5.82 10-13H2z"/><line x1="2" y1="9" x2="22" y2="9"/></svg>
<span data-i18n="ui.presetBowl">Bowl</span>
</button>
<button type="button" id="preset-model-suzanne" class="model-preset-btn" data-preset="suzanne" title="Suzanne (Blender Monkey 60mm)">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M8 15c1.5 2 6.5 2 8 0"/><path d="M3 10a3 3 0 0 0 3 3"/><path d="M21 10a3 3 0 0 1-3 3"/></svg>
<span data-i18n="ui.presetSuzanne">Suzanne</span>
</button>
<button type="button" id="preset-model-spot" class="model-preset-btn secret-preset-btn hidden" data-preset="spot" title="Spot (CC0 UV Color Cow 60mm)">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="8"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="13" r="2" fill="currentColor"/></svg>
<span data-i18n="ui.presetSpot">Spot</span>
</button>
</div>
<!-- Auto-fit Panel (Hidden mode) -->
<div id="autofit-controls" class="autofit-controls hidden">
<div class="model-preset-btns autofit-shape-btns">
<button type="button" id="autofit-shape-ngon" class="model-preset-btn active" data-autofit-shape="ngon" title="Regular n-gon Prism">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 21 8.5 21 15.5 12 22 3 15.5 3 8.5 12 2"/></svg>
<span data-i18n="ui.shapeNgon">n-gon</span>
</button>
<button type="button" id="autofit-shape-cylinder" class="model-preset-btn" data-autofit-shape="cylinder" title="Cylinder">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"/></svg>
<span data-i18n="ui.presetCylinder">Cylinder</span>
</button>
<button type="button" id="autofit-shape-bowl" class="model-preset-btn" data-autofit-shape="bowl" title="Bowl">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 9c0 7.18 4.48 13 10 13s10-5.82 10-13H2z"/><line x1="2" y1="9" x2="22" y2="9"/></svg>
<span data-i18n="ui.presetBowl">Bowl</span>
</button>
</div>
<div class="autofit-param-grid">
<div class="autofit-param-field">
<label for="autofit-height-input" data-i18n="ui.autofitHeight">Height (mm)</label>
<input type="number" id="autofit-height-input" value="100" min="5" max="500" step="1">
</div>
<div class="autofit-param-field">
<label for="autofit-repeat-input" data-i18n="ui.autofitRepeat">Panel count</label>
<input type="number" id="autofit-repeat-input" value="1" min="1" max="20" step="1">
</div>
<div class="autofit-param-field" id="autofit-ngon-field">
<label for="autofit-ngon-input" data-i18n="ui.autofitSides">Sides (n ≧ 3)</label>
<input type="number" id="autofit-ngon-input" value="6" min="3" max="64" step="1">
</div>
</div>
<div class="autofit-info-box" id="autofit-info-box">
Circumference: -- mm · Dia: -- mm
</div>
</div>
</div>
<div class="load-stl-row">
<label class="upload-btn" for="stl-file-input" style="flex:1;justify-content:center;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M12 2L2 7l10 5 10-5-10-5Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg>
<span data-i18n="ui.loadStl">Load Model…</span>
</label>
<button id="place-on-face-btn" class="place-on-face-btn" data-i18n-title="ui.placeOnFaceTitle" title="Click a face to orient it downward onto the print bed">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M12 3v14m0 0l-5-5m5 5l5-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21h16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
<span data-i18n="ui.placeOnFace">Place on Face</span>
</button>
<button id="rotate-btn" class="place-on-face-btn" data-i18n-title="ui.rotateTitle" title="Manually rotate the model around X, Y, Z axes">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M4 12a8 8 0 0 1 14.5-4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M20 12a8 8 0 0 1-14.5 4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M18.5 3v4.5H14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.5 21v-4.5H10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span data-i18n="ui.rotate">Rotate</span>
</button>
</div>
<div id="import-progress" class="export-progress hidden" style="margin-top:10px;margin-bottom:0;">
<div class="export-progress-track">
<div id="import-progress-bar" class="export-progress-bar"></div>
<span id="import-progress-pct" class="export-progress-pct"></span>
</div>
<span id="import-progress-label" data-i18n="progress.stepTessellate">Tessellating STEP model…</span>
</div>
<div id="rotate-controls" class="rotate-controls hidden">
<div class="rotate-inputs-row">
<div class="rotate-input-group">
<label for="rotate-x">X°</label>
<input type="number" id="rotate-x" class="val" value="0" step="1" />
</div>
<div class="rotate-input-group">
<label for="rotate-y">Y°</label>
<input type="number" id="rotate-y" class="val" value="0" step="1" />
</div>
<div class="rotate-input-group">
<label for="rotate-z">Z°</label>
<input type="number" id="rotate-z" class="val" value="0" step="1" />
</div>
<button id="rotate-apply-btn" class="rotate-apply-btn" data-i18n="ui.rotateApply">Apply</button>
<button id="rotate-reset-btn" class="rotate-reset-btn" data-i18n="ui.rotateReset">Reset</button>
</div>
</div>
<p style="margin:.4em 0 0;font-size:.75rem;opacity:.55;text-align:center;" data-i18n="ui.localProcessingNote">All processing runs locally in your browser — no data is uploaded.</p>
</section>
<!-- Displacement Map -->
<section class="panel-section">
<div class="model-presets-header" style="margin-bottom:6px;display:flex;justify-content:space-between;align-items:center;">
<h2 id="displacement-map-title" data-i18n="sections.displacementMap" style="margin:0;cursor:pointer;" title="Double click for secret Pattern Generator">Displacement Map</h2>
<div style="display:flex;align-items:center;gap:4px;">
<button type="button" id="secret-texgen-trigger" class="secret-mode-trigger" title="3-Color Pattern Generator (Secret Mode 1)" aria-label="3-Color Pattern Generator">✦</button>
<button type="button" id="secret-turing-trigger" class="secret-mode-trigger" title="3D Mesh Turing Pattern (Secret Mode 2)" aria-label="3D Mesh Turing Pattern" style="font-size:12px;line-height:1;">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12c2-4 5-4 8 0s6 4 8 0"/><path d="M4 18c2-4 5-4 8 0s6 4 8 0" opacity="0.5"/><path d="M4 6c2-4 5-4 8 0s6 4 8 0" opacity="0.5"/></svg>
</button>
</div>
</div>
<!-- Secret Texture Generator Launch Button (revealed by secret trigger or URL) -->
<button type="button" id="open-texgen-btn" class="texgen-open-trigger-btn hidden">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg>
<span data-i18n="ui.openTexGen">3-Color Pattern Generator</span>
<span style="font-size:9px;background:rgba(255,255,255,0.15);padding:1px 4px;border-radius:3px;">PRO</span>
</button>
<!-- 3D Mesh Turing Pattern Launch Button (Secret Mode 2: hidden text button) -->
<button type="button" id="open-turing-btn" class="texgen-open-trigger-btn hidden" style="background:linear-gradient(135deg,#10b981,#059669);margin-top:4px;">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12c2-4 5-4 8 0s6 4 8 0"/><path d="M4 18c2-4 5-4 8 0s6 4 8 0" opacity="0.6"/></svg>
<span data-i18n="ui.openTuring">3D Mesh Turing Pattern</span>
<span style="font-size:9px;background:rgba(255,255,255,0.2);padding:1px 4px;border-radius:3px;font-weight:700;">SECRET</span>
</button>
<!-- Texture layers: every layer has its own texture, projection/displacement settings and
surface mask; the sidebar always edits the highlighted one (js/main.js _renderLayerStrip) -->
<div id="layer-strip" class="layer-strip">
<div id="layer-list" class="layer-list" role="list"></div>
<button id="layer-add-btn" class="layer-add-btn" type="button"
data-i18n-title="layers.addTitle" title="Add a layer with its own texture, settings and surface">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
<span data-i18n="layers.add">Add layer</span>
</button>
</div>
<!-- Preset grid (Favourites) -->
<div id="preset-grid" class="preset-grid">
<!-- filled by js/textureGallery.js -->
</div>
<div class="map-actions">
<!-- Full catalogue -->
<button id="texture-gallery-btn" class="upload-btn gallery-open-btn" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
<span data-i18n="ui.textureGallery">Texture Gallery</span>
<span id="texture-gallery-count" class="gallery-open-count"></span>
</button>
<!-- Custom upload -->
<label class="upload-btn" for="texture-file-input">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12l7-7 7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
<span data-i18n="ui.uploadCustomMap">Upload custom map</span>
</label>
</div>
<input type="file" id="texture-file-input" accept="image/*,.texture" hidden />
<div id="custom-map-row" class="custom-map-row hidden">
<div id="custom-map-swatch" class="preset-swatch custom-map-swatch" role="button" tabindex="0" data-i18n-title="ui.customMap" title="Custom map"></div>
<button id="custom-map-remove" class="custom-map-remove" data-i18n-title="ui.removeCustomMap" data-i18n-aria-label="ui.removeCustomMap" title="Remove custom map" aria-label="Remove custom map">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="form-row invert-texture-row">
<label class="checkbox-label" for="invert-texture"
data-i18n-title="tooltips.invertTexture"
title="Swaps black and white in the displacement map, so dark areas become raised instead of light ones.">
<input type="checkbox" id="invert-texture" />
<span data-i18n="labels.invertTexture">Invert texture ⓘ</span>
</label>
</div>
<div class="form-row slider-row">
<label for="texture-smoothing" data-i18n="labels.textureSmoothing" data-i18n-title="tooltips.textureSmoothing" title="Applies a Gaussian blur to the displacement map. Higher values produce softer, more gradual surface detail. 0 = off.">Texture Smoothing ⓘ</label>
<input type="range" id="texture-smoothing" min="0" max="20" step="any" value="0" />
<input type="number" class="val" id="texture-smoothing-val" value="0" min="0" max="20" step="any" data-wheel-decimals="1" />
</div>
</section>
<!-- Color & Multi-Tool -->
<section class="panel-section" id="color-multitool-section">
<div class="section-header-row color-section-header">
<h2 class="color-section-title">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/></svg>
<span data-i18n="color.sectionTitle">Color & Multi-Tool</span>
</h2>
<label class="checkbox-label color-enable-label" for="color-mode-toggle">
<input type="checkbox" id="color-mode-toggle" checked />
<span class="color-enable-text" data-i18n="color.enabled">有効</span>
</label>
</div>
<div id="color-multitool-controls">
<!-- Mode Tabs -->
<div class="color-mode-tabs">
<button type="button" id="tab-color-quantize" class="color-tab-btn active" data-i18n="color.tabQuantize">カラー量子化</button>
<button type="button" id="tab-color-layerblend" class="color-tab-btn" data-i18n="color.tabLayerBlend">交互積層 (振り重ね)</button>
</div>
<div class="form-row color-quick-toggles">
<label class="checkbox-label" for="color-preview-toggle">
<input type="checkbox" id="color-preview-toggle" checked />
<span data-i18n="color.show3DPreview">3Dプレビューで色を表示</span>
</label>
<label class="checkbox-label" for="color-flat-top-toggle" data-i18n-title="color.flatTopTitle" title="上向き水平面(天井)へのテクスチャ適用と段差を無効化し、滑らかな天面インフィルで印刷します。">
<input type="checkbox" id="color-flat-top-toggle" checked />
<span data-i18n="color.flatTop">天井面フラット化 (推奨)</span>
</label>
</div>
<!-- Extruder Count (Top & Prominent) -->
<div class="form-row slider-row color-extruder-card">
<label for="color-count-slider" data-i18n="color.extruderCount" data-i18n-title="color.extruderCountTitle" title="減色する代表色の数(Extruder数)">Extruder数 (色数)</label>
<input type="range" id="color-count-slider" min="2" max="8" step="1" value="4" />
<span class="val" id="color-count-val">4</span>
</div>
<!-- Palette Extraction Mode (Area vs Gamut Basis) -->
<div class="form-row color-extract-row">
<label for="quantize-mode-select" data-i18n="color.quantizeMode" data-i18n-title="color.quantizeModeTitle" title="パレット色の抽出アルゴリズム。面積優先はベタ塗り向け、混色基底は交互積層のグラデーション向けです。">抽出方式</label>
<select id="quantize-mode-select" class="interleaved-select">
<option value="area" selected data-i18n-opt="color.quantizeModeArea">面積優先 (標準)</option>
<option value="gamut" data-i18n-opt="color.quantizeModeGamut">混色基底 (グラデーション)</option>
</select>
</div>
<p id="palette-custom-color-hint" class="color-mode-hint hidden" style="margin:2px 0 6px;font-size:10.5px;">色チップをクリックするとフィラメントの色を自由に変更できます。</p>
<!-- Color Palette List (Shared across both Quantize and Interleaved tabs) -->
<div class="palette-container" id="palette-list">
<!-- JSで動的にカラーパレットカードを生成 -->
</div>
<!-- Tab 1: Color Quantization Panel (Phase 1) -->
<div id="quantize-controls-container">
<p class="color-mode-hint">各領域を最も近いパレット色のツールへ直接割り当ててマルチカラー3MFを出力します。</p>
</div>
<!-- Tab 2: Interleaved Layer Blending Panel (Phase 2) -->
<div id="layerblend-controls-container" class="hidden" style="margin-top:6px;">
<!-- Shading Source Selection (Texture Map / Mesh Curvature / Multi-color Filament) -->
<div class="form-row color-subcard">
<label for="shading-source-select" data-i18n="color.shadingSource" title="陰影・色分けの入力元。外部テクスチャ画像、モデル自身の立体凹凸(曲率)、または面の向きに応じた多色フィラメント風モードを選びます。" style="font-weight:600;">陰影ソース</label>
<select id="shading-source-select" class="interleaved-select">
<option value="texture" selected data-i18n-opt="color.shadingSourceTexture">テクスチャ画像 (Texture Map)</option>
<option value="curvature" data-i18n-opt="color.shadingSourceCurvature">モデルの凹凸 (Mesh Curvature / UV不要)</option>
<option value="filament" data-i18n-opt="color.shadingSourceFilament">多色フィラメント (Co-extrusion / 法線方向)</option>
</select>
</div>
<!-- Multi-color Filament Options (Visible when shading-source == 'filament') -->
<div id="filament-options-container" class="hidden color-accent-box">
<div class="color-accent-box-title">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 3v18"/><path d="M12 12l7.8 4.5"/></svg>
<span data-i18n="color.filamentSettings">多色フィラメント設定 (法線方向)</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="filament-angle" data-i18n="color.filamentAngle" title="Tool 1(色A)が正面を向く方位角(0° = +X方向)">方位角 / 回転 (°)</label>
<input type="range" id="filament-angle" min="0" max="360" step="5" value="0" />
<div class="filament-angle-input-wrap">
<input type="number" id="filament-angle-input" class="filament-angle-num" min="0" max="360" step="1" value="0" aria-label="方位角 (°)" />
<span class="filament-angle-unit">°</span>
</div>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="filament-sharpness" data-i18n="color.filamentSharpness" title="色境界のシャープさ(0 = 滑らかなグラデーション、1 = くっきり切替)">境界シャープさ</label>
<input type="range" id="filament-sharpness" min="0.00" max="1.00" step="0.05" value="0.30" />
<span class="val" id="filament-sharpness-val">0.30</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="filament-twist" data-i18n="color.filamentTwist" title="高さ(Z)に応じた方位角のねじれ(°/mm)。0で固定方向、値を入れると螺旋状に色が回転します。">Zツイスト (°/mm)</label>
<input type="range" id="filament-twist" min="-10.0" max="10.0" step="0.5" value="0.0" />
<span class="val" id="filament-twist-val">0.0</span>
</div>
<p class="color-mode-hint" style="margin:4px 0 0;font-size:10.5px;opacity:0.85;">面の向き(法線方向)に応じてパレット色を360°均等に割り当てます。複雑な形状でもテクスチャ不要で2色・3色フィラメント風の視覚効果が得られます。</p>
</div>
<!-- Curvature Shading Options (Visible when shading-source == 'curvature') -->
<div id="curvature-options-container" class="hidden color-accent-box">
<div class="color-accent-box-title">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 17c3-6 6-10 9-10s6 4 9 10"/><path d="M3 12c3-4 6-7 9-7s6 3 9 7" opacity="0.45"/></svg>
<span data-i18n="color.curvatureSettings">メッシュ凹凸シェーディング設定</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="curvature-radius" data-i18n="color.curvatureRadius" title="凹凸を検出する空間半径(大きいほど大まかな陰影、小さいほど微細な溝)">検出半径 (mm)</label>
<input type="range" id="curvature-radius" min="1.0" max="15.0" step="0.5" value="3.5" />
<span class="val" id="curvature-radius-val">3.5</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="curvature-scale" data-i18n="color.curvatureScale" title="凹凸のコントラスト・感度">コントラスト</label>
<input type="range" id="curvature-scale" min="0.2" max="3.0" step="0.1" value="1.0" />
<span class="val" id="curvature-scale-val">1.0</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="curvature-bias" data-i18n="color.curvatureBias" title="平坦部の基本明度(0.5 = 中間グレー)">明るさバイアス</label>
<input type="range" id="curvature-bias" min="0.0" max="1.0" step="0.05" value="0.5" />
<span class="val" id="curvature-bias-val">0.50</span>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<label for="curvature-smooth" data-i18n="color.curvatureSmooth" title="ポリゴン小面のノイズを抑える平滑化回数">平滑化 (ノイズ低減)</label>
<input type="range" id="curvature-smooth" min="0" max="6" step="1" value="2" />
<span class="val" id="curvature-smooth-val">2</span>
</div>
<div class="form-row" style="margin-top:4px;">
<label class="checkbox-label" for="curvature-invert" style="font-size:11px;cursor:pointer;">
<input type="checkbox" id="curvature-invert" />
<span data-i18n="color.curvatureInvert">凹凸の白黒を反転 (凸部を黒・凹部を白)</span>
</label>
</div>
</div>
<div class="form-row slider-row" style="margin-bottom:8px;">
<label for="interleaved-layer-thickness" data-i18n="color.layerThickness" data-i18n-title="color.layerThicknessTitle" title="各ツールの1層あたりの厚み(スライサーの積層ピッチに合わせます)">積層厚み (mm)</label>
<input type="range" id="interleaved-layer-thickness" min="0.04" max="1.00" step="0.02" value="0.20" />
<span class="val" id="interleaved-layer-thickness-val">0.20</span>
</div>
<div class="form-row slider-row" style="margin-bottom:8px;">
<label for="interleaved-convex-amp" data-i18n="color.convexAmp" data-i18n-title="color.convexAmpTitle" title="目的色と一致する層の突出量(凸量)">凸量 / 突出 (mm)</label>
<input type="range" id="interleaved-convex-amp" min="0.00" max="3.00" step="0.05" value="0.80" />
<span class="val" id="interleaved-convex-amp-val">0.80</span>
</div>
<div class="form-row slider-row" style="margin-bottom:8px;">
<label for="interleaved-concave-amp" data-i18n="color.concaveAmp" data-i18n-title="color.concaveAmpTitle" title="目的色と一致しない層の引っ込み量(凹量)">凹量 / 引込 (mm)</label>
<input type="range" id="interleaved-concave-amp" min="0.00" max="1.50" step="0.05" value="0.00" />
<span class="val" id="interleaved-concave-amp-val">0.00</span>
</div>
<div class="form-row color-accent-row" id="interleaved-base-displacement-row">
<label for="interleaved-enable-base-displacement" style="cursor:pointer;display:flex;align-items:center;gap:6px;" data-i18n-title="color.enableBaseDisplacementTitle" title="BumpMesh本来の大きな凹凸変位(Amplitude)をベースメッシュに適用した上で、各層の振り重ねを行います。デフォルトは無効(フラットベースに微小段差のみ適用)。">
<input type="checkbox" id="interleaved-enable-base-displacement" style="cursor:pointer;">
<span data-i18n="color.enableBaseDisplacement" class="color-accent-label">ベースの凹凸変位 (Amplitude) を併用</span>
</label>
</div>
<div class="form-row" id="interleaved-profile-mode-card">
<label for="interleaved-profile-mode" data-i18n="color.profileMode" data-i18n-title="color.profileModeTitle" title="層ごとの断面形状。フラット段差は直線が美しく、他作品のような綺麗な仕上がりになる標準方式です。" style="font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px;margin-bottom:6px;cursor:pointer;width:100%;">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 18h6v-6h6V6h4"/></svg>
<span>断面形状 (遮蔽・造形方式)</span>
</label>
<select id="interleaved-profile-mode" class="interleaved-select profile-mode-select-prominent">
<option value="0" selected data-i18n-opt="color.profileStep">フラット段差(標準ステップ・推奨)</option>
<option value="6" data-i18n-opt="color.profileModulated">フラット変調(任意メッシュ・波形追従)</option>
<option value="1" data-i18n-opt="color.profileLouver">45° ルーバー庇(他色シールド・実験的)</option>
<option value="4" data-i18n-opt="color.profileBlock">矩形ブロック編み重ね</option>
<option value="3" data-i18n-opt="color.profileZigzag">三角波編み重ね(ジグザグ・軽量高速)</option>
<option value="2" data-i18n-opt="color.profileWeave">正弦波編み重ね(サイン波ハーフトーン)</option>
<option value="5" data-i18n-opt="color.profileHalftone">ハーフトーン編み(内壁固定・写真・多色向け)</option>
</select>
</div>
<!-- Weave Parameters (Visible when profile-mode is weave/zigzag/block) -->
<div id="interleaved-weave-container" class="hidden color-weave-card">
<div class="color-weave-card-title">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12c2.5-5 5-5 7.5 0s5 5 7.5 0 3.5-3.5 5 0"/></svg>
<span data-i18n="color.weaveSettings">編み重ねハーフトーン設定</span>
</div>
<div class="form-row" style="margin-bottom:6px;">
<label for="interleaved-nozzle-preset" data-i18n="color.nozzleDiameter" title="使用するプリンタのノズル口径(線幅)。波長ピッチと振幅の推奨基準になります。">ノズル径 (mm)</label>
<div style="display:flex;gap:6px;flex:1;align-items:center;">
<select id="interleaved-nozzle-preset" class="interleaved-select" style="flex:1;">
<option value="0.1">0.1 mm</option>
<option value="0.2">0.2 mm</option>
<option value="0.25">0.25 mm</option>
<option value="0.4" selected data-i18n-opt="color.nozzleStandard">0.4 mm (Standard)</option>
<option value="0.6">0.6 mm</option>
<option value="0.8">0.8 mm</option>
<option value="1.0">1.0 mm</option>
<option value="1.2">1.2 mm</option>
<option value="2.0">2.0 mm</option>
<option value="custom" data-i18n-opt="color.nozzleCustom">Manual Input (Custom)</option>
</select>
<input type="number" id="interleaved-nozzle-custom" class="color-nozzle-custom-input" min="0.05" max="3.0" step="0.05" value="0.40" />
</div>
</div>
<div class="form-row slider-row" style="margin-bottom:6px;">
<div style="display:flex;justify-content:space-between;width:100%;align-items:center;">
<label for="interleaved-weave-pitch" data-i18n="color.weavePitch" title="サイン波の波長ピッチ(mm)。1周の波の細かさを決めます。推奨: ノズル径 × 4.0">波長ピッチ (mm)</label>
<span id="weave-pitch-rec" class="color-rec-link" data-i18n-title="color.weaveRecTitle" title="Click to auto-set recommended value">推奨: 1.60mm</span>
</div>
<input type="range" id="interleaved-weave-pitch" min="0.3" max="8.0" step="0.05" value="1.6" />
<span class="val" id="interleaved-weave-pitch-val">1.60</span>
</div>
<div class="form-row slider-row" style="margin-bottom:4px;">
<div style="display:flex;justify-content:space-between;width:100%;align-items:center;">
<label for="interleaved-weave-amp" data-i18n="color.weaveAmp" title="波・ブロックの最大突出振幅(mm)。十分なプリプリ感を出すにはノズル径の1.5〜2倍(0.6〜1.0mm)を推奨">波の振幅 (mm)</label>
<span id="weave-amp-rec" class="color-rec-link" data-i18n-title="color.weaveRecTitle" title="Click to auto-set recommended value">推奨: 0.60mm</span>
</div>
<input type="range" id="interleaved-weave-amp" min="0.05" max="2.50" step="0.05" value="0.60" />
<span class="val" id="interleaved-weave-amp-val">0.60</span>
</div>
<div id="weave-amp-warning" class="hidden ux-warn-text" data-i18n="color.weaveAmpWarning">
Amplitude exceeds 300% of nozzle diameter. Inter-layer bonding may be compromised.
</div>
<!-- Solid Fill vs Hollow Rubber Band Toggle -->
<div class="form-row" style="margin-top:6px;margin-bottom:4px;">
<label for="interleaved-weave-solid-toggle" class="checkbox-label" style="font-size:11px;cursor:pointer;" title="輪ゴム状の中空シェルではなく、全層を中身が詰まったソリッド断面(中充填)として出力します。スライサー側で任意のインフィルや重り設定が可能になります。">
<input type="checkbox" id="interleaved-weave-solid-toggle" />
<span>中充填(ソリッド断面 / OFF=輪ゴム中空)</span>
</label>
</div>
<!-- Tool-by-Tool Weave / Flat Mode: consolidated into the palette rows above -->
<div id="weave-tool-modes-section" class="hidden">
<div id="weave-tool-modes-container"></div>
</div>
<!-- Profile 5: Flat Step Amplitude Scale Slider (visible when Profile 5 is active) -->
<div id="interleaved-flat-scale-row" class="form-row slider-row hidden" style="margin-top:8px;padding-top:6px;border-top:1px dashed var(--border);">
<div style="display:flex;justify-content:space-between;width:100%;align-items:center;">
<label for="interleaved-flat-scale" data-i18n="color.flatAmpScale" data-i18n-title="color.flatAmpScaleTitle" title="ハーフトーン編みにおいて、フラット(━)に設定したツールの突出量倍率を調整します (1.0 = 等倍、0.5 = 半分)">フラット振幅倍率</label>
<span id="flat-scale-reset" class="color-rec-link" title="リセット (1.00)">1.00x</span>
</div>
<input type="range" id="interleaved-flat-scale" min="0.0" max="2.0" step="0.05" value="1.0" />
<span class="val" id="interleaved-flat-scale-val">1.00</span>
</div>
</div>
<div class="form-row" style="margin-bottom:8px;">
<label for="interleaved-shading-mode" data-i18n="color.shadingMode" data-i18n-title="color.shadingModeTitle" title="色の階調表現。シャープはくっきりした二値、グラデーションは元画像の連続階調に応じて出っ張り量を無段階制御します。">階調表現</label>
<select id="interleaved-shading-mode" class="interleaved-select">
<option value="0" data-i18n-opt="color.shadingSharp">シャープ (二値 / 0-1)</option>
<option value="1" selected data-i18n-opt="color.shadingGradient">グラデーション (連続階調)</option>
</select>
</div>
<div class="form-row" id="interleaved-gamma-row" style="margin-bottom:10px;">
<label for="interleaved-gamma" data-i18n="color.interleavedGamma" data-i18n-title="color.interleavedGammaTitle" title="グラデーションの明暗カーブ(ガンマ補正)。1.0が標準フルレンジ、値が大きいほど黒が引き締まり、小さいほど暗部が明るくなります。">階調調整 (ガンマ)</label>
<div class="slider-row" style="display:flex;align-items:center;gap:8px;">
<input type="range" id="interleaved-gamma" min="0.4" max="2.2" step="0.05" value="1.0" style="flex:1;">
<span id="interleaved-gamma-val" style="min-width:32px;font-size:11px;font-family:monospace;text-align:right;">1.00</span>
</div>
</div>
<div class="form-row" id="interleaved-invert-row" style="margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;">
<label for="interleaved-invert-tools" style="cursor:pointer;display:flex;align-items:center;gap:6px;" data-i18n-title="color.interleavedInvertToolsTitle" title="Tool 1とTool 2の突出/階調の割り当てを反転します。白黒が逆に印刷される場合にONにしてください。">
<input type="checkbox" id="interleaved-invert-tools" style="cursor:pointer;">
<span data-i18n="color.interleavedInvertTools">色/ツール反転 (Tool 1 ↔ Tool 2)</span>
</label>
</div>
<div class="form-row" style="margin-bottom:8px;">
<label for="interleaved-exclusion-mode" data-i18n="color.interleavedExclusionMode" data-i18n-title="color.interleavedExclusionModeTitle" title="除外ペイントで指定した領域の処理方法">除外領域の処理</label>
<select id="interleaved-exclusion-mode" class="interleaved-select" style="font-size:11px;">
<option value="0" selected data-i18n-opt="color.exclMode1">1. 凹凸OFF / ペイントOFF (指定ツール塗りつぶし)</option>
<option value="1" data-i18n-opt="color.exclMode2">2. 凹凸OFF / ペイントON (指定ツール出っ張り交互積層)</option>
<option value="2" data-i18n-opt="color.exclMode3">3. 凹凸ON / ペイントOFF (指定ツール塗りつぶし立体)</option>
<option value="3" data-i18n-opt="color.exclMode4">4. 凹凸ON / ペイントON (指定ツール無視フラット交互積層)</option>
</select>
</div>
<!-- Independent prominent preview button -->
<button id="interleaved-preview-map-btn" type="button" class="btn btn-secondary color-preview-map-btn">
<svg class="ui-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>
<span data-i18n="color.interleavedPreviewMap">振り重ね変調画像(2Dマップ)を確認</span>
</button>
</div>
<!-- Bottom & Discreet: Untextured Tool -->
<div class="untextured-tool-row">
<label for="untextured-tool-select" data-i18n="color.untexturedTool" data-i18n-title="color.untexturedToolTitle" title="マスク領域やテクスチャを適用しない面(底面など)に割り当てるツール">非テクスチャ部ツール (底面等)</label>
<select id="untextured-tool-select">
<option value="1">Tool 1</option>
<option value="2">Tool 2</option>
<option value="3">Tool 3</option>
<option value="4" selected>Tool 4</option>
</select>
</div>
</div>
</section>
<!-- Projection -->
<section class="panel-section">
<h2 data-i18n="sections.projection">Projection</h2>
<div class="form-row">
<label for="mapping-mode" data-i18n="labels.mode">Mode</label>
<select id="mapping-mode">
<option value="8" hidden disabled data-i18n-opt="projection.surfaceNormal">Surface normal</option>
<option value="5" selected data-i18n-opt="projection.triplanar">Triplanar</option>
<option value="6" data-i18n-opt="projection.cubic">Cubic (Box)</option>
<option value="3" data-i18n-opt="projection.cylindrical">Cylindrical</option>
<option value="4" data-i18n-opt="projection.spherical">Spherical</option>
<option value="0" data-i18n-opt="projection.planarXY">Planar XY</option>
<option value="1" data-i18n-opt="projection.planarXZ">Planar XZ</option>
<option value="2" data-i18n-opt="projection.planarYZ">Planar YZ</option>
<option value="7" data-i18n-opt="projection.meshUV">Mesh UV (Intrinsic)</option>
</select>
</div>
<div class="form-row slider-row" style="display:none">
<label for="seam-blend" data-i18n="labels.seamBlend" data-i18n-title="tooltips.seamBlend" title="Softens the hard seam where projection faces meet. Effective for Cubic and Cylindrical modes.">Seam Blend ⓘ</label>
<input type="range" id="seam-blend" min="0" max="1" step="0.01" value="1" />
<input type="number" class="val" id="seam-blend-val" value="1" min="0" max="1" step="0.01" />
</div>
<div class="form-row slider-row">
<label for="seam-band-width" data-i18n="labels.transitionSmoothing" data-i18n-title="tooltips.transitionSmoothing" title="Width of the blending zone near seam edges. Lower values keep transitions tight to the seam; higher values blend a wider band.">Transition Smoothing ⓘ</label>
<input type="range" id="seam-band-width" min="0" max="1" step="0.01" value="0.5" />
<input type="number" class="val" id="seam-band-width-val" value="0.5" min="0" max="1" step="0.01" data-wheel-decimals="2" />
</div>
<div class="form-row slider-row" id="cap-angle-row" style="display:none">
<label for="cap-angle" data-i18n="labels.capAngle" data-i18n-title="tooltips.capAngle" title="Angle (in degrees) from vertical at which the top/bottom cap projection kicks in. Smaller values limit cap projection to nearly flat faces.">Cap Angle ⓘ</label>
<input type="range" id="cap-angle" min="1" max="89" step="1" value="20" />
<input type="number" class="val" id="cap-angle-val" value="20" min="1" max="89" step="1" />
</div>
<div class="form-row" id="cylinder-snap-row" style="display:none">
<label class="checkbox-label" for="cylinder-snap-toggle"
data-i18n-title="tooltips.snapSeamless"
title="Snap U scale to integer wrap counts so the texture seamlessly wraps around the cylinder or sphere.">
<input type="checkbox" id="cylinder-snap-toggle" checked />
<span data-i18n="labels.snapSeamless">Snap to seamless wrap ⓘ</span>
</label>
</div>
<div class="form-row" id="cylinder-axis-row" style="display:none">
<label data-i18n="labels.cylinderAxis">Cylinder Axis</label>
<div class="cylinder-axis-controls">
<button id="cylinder-autofit-btn" type="button" class="cylinder-axis-btn"
data-i18n="ui.cylinderAutofit"
data-i18n-title="tooltips.cylinderAutofit"
title="Fit a circle to the part's outward-facing vertices (least-squares).">Auto-fit</button>
<button id="cylinder-reset-btn" type="button" class="cylinder-axis-btn"
data-i18n="ui.cylinderReset"
data-i18n-title="tooltips.cylinderReset"
title="Reset to AABB center and AABB-derived radius.">Reset</button>
</div>
</div>
<div class="form-row" id="stamp-mode-row">
<div class="cylinder-axis-controls">
<button id="stamp-mode-btn" type="button" class="cylinder-axis-btn" aria-pressed="false"
data-i18n="ui.stampMode"
data-i18n-title="tooltips.stamp"
title="Apply the texture once instead of tiling it, for logos, badges and labels. Click the model to position it; Size U and V set its size. While it is on, only the Surface normal, Planar and Cylindrical projections are available; Surface normal lines the stamp up with the surface under its centre.">Stamp mode</button>
</div>
</div>
<div class="form-row" id="stamp-place-row" style="display:none">
<div class="cylinder-axis-controls">
<button id="stamp-place-btn" type="button" class="cylinder-axis-btn"
data-i18n="ui.stampPlace"
data-i18n-title="tooltips.stampPlace"
title="Click the model to centre the stamp there. Hold and drag to slide it along the surface.">Position on model</button>
</div>
</div>
<p id="stamp-hint" class="advanced-blurb stamp-hint" style="display:none" data-i18n="ui.stampHint">Drag the stamp on the model to move it, then scroll to resize it.</p>
</section>
<!-- Displacement -->
<section class="panel-section">
<h2 data-i18n="sections.displacement">Displacement</h2>
<div class="form-row slider-row">
<label for="amplitude" data-i18n="labels.textureHeight">Texture height (mm)</label>
<input type="range" id="amplitude" min="0" max="2" step="0.01" value="0.5" />
<input type="number" class="val" id="amplitude-val" value="0.5" min="0" max="100" step="0.01" data-wheel-decimals="2" />
</div>
<div class="form-row">
<label class="checkbox-label" for="invert-displacement">
<input type="checkbox" id="invert-displacement" />
<span data-i18n="labels.invertDisplacement">Invert (push in instead of out)</span>
</label>
</div>
<div id="amplitude-warning" class="amplitude-warning hidden" data-i18n="warnings.textureHeightOverlap">
⚠ Texture height exceeds 10% of the smallest model dimension — geometry overlaps may occur in the exported STL.
</div>
<div class="form-row">
<label class="checkbox-label" for="symmetric-displacement"
data-i18n-title="tooltips.symmetricDisplacement"
title="When on, 50% grey = no displacement; white pushes out, black pushes in. Keeps part volume roughly constant.">
<input type="checkbox" id="symmetric-displacement" />
<span data-i18n="labels.symmetricDisplacement">Symmetric displacement ⓘ</span>
</label>
</div>
<div class="form-row">
<label class="checkbox-label" for="displacement-preview"
data-i18n-title="tooltips.displacementPreview"
title="Subdivides the mesh and displaces vertices in real-time so you can judge the actual depth. GPU-intensive on complex models.">
<input type="checkbox" id="displacement-preview" />
<span data-i18n="labels.displacementPreview">3D Preview ⓘ</span>
</label>
</div>
</section>
<!-- Transform -->
<section class="panel-section">
<h2 data-i18n="sections.transform">Transform</h2>
<p class="advanced-blurb" data-i18n="labels.scaleManualHint">Type a value in the box for smaller or larger sizes</p>
<div class="form-row slider-row">
<label for="scale-u" data-i18n="labels.textureSizeU" data-i18n-title="tooltips.textureSize" title="Physical size of one texture repeat in millimetres — the same value gives the same physical pattern size on any model.">Size U (mm)</label>
<input type="range" id="scale-u" min="0" max="1000" step="1" value="435" />
<input type="number" class="val" id="scale-u-val" value="25" min="0.01" max="10000" step="0.5" />
</div>
<div class="lock-row">
<div class="lock-line"></div>
<button id="lock-scale" class="lock-btn active" data-i18n-title="tooltips.proportionalScaling" data-i18n-aria-label="tooltips.proportionalScalingAria" title="Proportional scaling (U = V)" aria-pressed="true">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none">
<rect x="3" y="11" width="18" height="11" rx="2" stroke="currentColor" stroke-width="2"/>
<path d="M7 11V7a5 5 0 0 1 10 0v4" stroke="currentColor" stroke-width="2"/>
</svg>
</button>
<div class="lock-line"></div>
</div>
<div class="form-row slider-row">
<label for="scale-v" data-i18n="labels.textureSizeV" data-i18n-title="tooltips.textureSize" title="Physical size of one texture repeat in millimetres — the same value gives the same physical pattern size on any model.">Size V (mm)</label>
<input type="range" id="scale-v" min="0" max="1000" step="1" value="435" />
<input type="number" class="val" id="scale-v-val" value="25" min="0.01" max="10000" step="0.5" />
</div>
<div class="form-row slider-row">
<label for="offset-u" data-i18n="labels.offsetU">Offset U</label>
<input type="range" id="offset-u" min="-1" max="1" step="0.01" value="0" />
<input type="number" class="val" id="offset-u-val" value="0" min="-1" max="1" step="0.01" />
</div>
<div class="form-row slider-row">
<label for="offset-v" data-i18n="labels.offsetV">Offset V</label>
<input type="range" id="offset-v" min="-1" max="1" step="0.01" value="0" />
<input type="number" class="val" id="offset-v-val" value="0" min="-1" max="1" step="0.01" />
</div>
<div class="form-row slider-row">
<label for="rotation" data-i18n="labels.rotation">Rotation</label>
<input type="range" id="rotation" min="0" max="360" step="1" value="0" />
<input type="number" class="val" id="rotation-val" value="0" min="0" max="360" step="1" />
</div>
</section>
<!-- Masking -->
<section class="panel-section">
<h2 data-i18n="sections.masking">Masking</h2>
<!-- By Angle -->
<h3 class="panel-subsection-heading" data-i18n="sections.maskAngles" data-i18n-title="tooltips.maskAngles" title="0° = no masking. Surfaces within this angle of horizontal will not be textured.">By Angle ⓘ</h3>
<div class="form-row slider-row">
<label for="bottom-angle-limit" data-i18n="labels.bottomFaces" data-i18n-title="tooltips.bottomFaces" title="Suppress texture on downward-facing surfaces within this angle of horizontal">Bottom faces</label>
<input type="range" id="bottom-angle-limit" min="0" max="90" step="1" value="5" />
<input type="number" class="val" id="bottom-angle-limit-val" value="5" min="0" max="90" step="1" />
</div>
<div class="form-row slider-row">
<div style="display:flex;align-items:center;gap:6px;">
<input type="checkbox" id="masking-top-angle-toggle" checked style="cursor:pointer;margin:0;" data-i18n-title="tooltips.topFaces" title="天井マスキングの有効/無効" />
<label for="top-angle-limit" data-i18n="labels.topFaces" data-i18n-title="tooltips.topFaces" title="Suppress texture on upward-facing surfaces within this angle of horizontal" style="cursor:pointer;margin:0;">Top faces</label>
</div>
<input type="range" id="top-angle-limit" min="0" max="90" step="1" value="20" />
<input type="number" class="val" id="top-angle-limit-val" value="20" min="0" max="90" step="1" />
</div>
<!-- By Surface -->
<h3 class="panel-subsection-heading" id="excl-section-heading" data-i18n="sections.surfaceMasking" data-i18n-title="tooltips.surfaceMasking" title="Mask surfaces to control which areas receive displacement.">By Surface ⓘ</h3>
<p id="excl-hint" class="excl-hint" style="display:none"></p>
<!-- Mode toggle: Exclude / Include Only -->
<div class="excl-mode-row">
<div class="excl-seg">
<button id="excl-mode-exclude" class="excl-seg-btn" aria-pressed="false"
data-i18n="excl.modeExclude" data-i18n-title="excl.modeExcludeTitle"
title="Exclude mode: painted surfaces will not receive texture displacement">Exclude</button>
<button id="excl-mode-include" class="excl-seg-btn" aria-pressed="false"
data-i18n="excl.modeIncludeOnly" data-i18n-title="excl.modeIncludeOnlyTitle"
title="Include Only mode: only painted surfaces will receive texture displacement">Include Only</button>
</div>
</div>
<!-- Tool buttons -->
<div class="excl-tools">
<button id="excl-brush-btn" class="excl-tool-btn" aria-pressed="false"
data-i18n-title="excl.toolBrushTitle"
title="Brush: paint triangles to exclude">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h2c1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/>
<path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h2c1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/>
</svg>
<span data-i18n="excl.toolBrush">Brush</span>
</button>
<button id="excl-bucket-btn" class="excl-tool-btn" aria-pressed="false"
data-i18n-title="excl.toolFillTitle"
title="Bucket fill: flood-fill surface up to a threshold angle">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 11V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9"/>
<path d="M13 17h8m-4-4 4 4-4 4"/>
</svg>
<span data-i18n="excl.toolFill">Fill</span>
</button>
</div>
<!-- Precision masking toggle -->
<div id="precision-masking-row" class="form-row precision-masking-row hidden">
<label class="precision-label">
<input type="checkbox" id="precision-masking-toggle" />
<span data-i18n="precision.label" data-i18n-title="precision.labelTitle"
title="Subdivide mesh in the background so the brush selects at finer granularity">Precision ⓘ</span>
</label>
<span id="precision-status" class="precision-status"></span>
<span id="precision-outdated" class="precision-outdated hidden"
data-i18n="precision.outdated">⚠ Outdated</span>
<button id="precision-refresh-btn" class="precision-refresh-btn hidden"
data-i18n-title="precision.refreshTitle"
title="Re-subdivide mesh to match current brush size">⟳</button>
</div>
<div id="precision-warning" class="precision-warning hidden"></div>
<!-- Brush type switcher (shown only when Brush is active) -->
<div id="excl-brush-type-row" class="form-row hidden">
<span id="excl-brush-type-label" class="form-row-label" data-i18n="labels.type">Type</span>
<div class="excl-seg" role="group" aria-labelledby="excl-brush-type-label">
<button id="excl-brush-single" class="excl-seg-btn" data-i18n="brushType.single">Single</button>
<button id="excl-brush-radius-btn" class="excl-seg-btn active" data-i18n="brushType.circle">Circle</button>
</div>
</div>
<!-- Circle brush mode (shown when Brush + Circle) -->
<div id="excl-brush-mode-row" class="form-row hidden">
<span id="excl-brush-mode-label" class="form-row-label" data-i18n="brushMode.label">Mode</span>
<div class="excl-seg" role="group" aria-labelledby="excl-brush-mode-label">
<button id="excl-brush-standard" class="excl-seg-btn"
data-i18n="brushMode.standard" data-i18n-title="brushMode.standardTitle"
title="Marks every whole triangle the brush touches. Quick for selecting flat faces of CAD models.">Standard</button>
<button id="excl-brush-precision" class="excl-seg-btn active"
data-i18n="brushMode.precision" data-i18n-title="brushMode.precisionTitle"
title="Splits the triangles under the brush so the mask follows the brush outline exactly, with an optional soft edge.">Precision</button>
</div>
</div>
<!-- Radius slider (shown when Brush + Radius) -->
<div id="excl-radius-row" class="form-row slider-row hidden">