Refactor surface masking and exclusion features

- Renamed "Surface Mask" section to "Mask Angles" for clarity in index.html.
- Updated translation keys and tooltips to reflect the new terminology in i18n.js.
- Removed the erase toggle button from the exclusion panel and implemented Shift key functionality to toggle erase mode in main.js.
- Adjusted brush radius handling to improve user experience and updated related UI elements in index.html.
- Enhanced the subdivision process to track original face IDs for better masking accuracy in subdivision.js.
- Added CSS styles for new UI elements and improved layout in style.css.
This commit is contained in:
CNCKitchen
2026-03-21 09:42:08 +01:00
parent a5cb0e5671
commit 6723dcb7b0
5 changed files with 275 additions and 115 deletions
+9 -18
View File
@@ -213,9 +213,9 @@
</div>
</section>
<!-- Surface Mask -->
<!-- Mask Angles -->
<section class="panel-section">
<h2 data-i18n="sections.surfaceMask" data-i18n-title="tooltips.surfaceMask" title="0° = no masking. Surfaces within this angle of horizontal will not be textured.">Surface Mask</h2>
<h2 data-i18n="sections.maskAngles" data-i18n-title="tooltips.maskAngles" title="0° = no masking. Surfaces within this angle of horizontal will not be textured.">Mask Angles</h2>
<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" />
@@ -230,7 +230,7 @@
<!-- Surface Exclusions -->
<section class="panel-section">
<h2 id="excl-section-heading" data-i18n="sections.surfaceExclusions" data-i18n-title="tooltips.surfaceExclusions" title="Excluded surfaces appear orange and will not receive displacement during export.">Surface Exclusions</h2>
<h2 id="excl-section-heading" data-i18n="sections.surfaceMasking" data-i18n-title="tooltips.surfaceMasking" title="Mask surfaces to control which areas receive displacement.">Surface Masking</h2>
<p id="excl-hint" class="excl-hint" style="display:none"></p>
<!-- Mode toggle: Exclude / Include Only -->
@@ -265,16 +265,6 @@
</svg>
<span data-i18n="excl.toolFill">Fill</span>
</button>
<button id="excl-erase-toggle" class="excl-tool-btn" aria-pressed="false"
data-i18n-title="excl.toolEraseTitle"
title="Toggle: mark or erase mode">
<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="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/>
<path d="M22 21H7"/>
<path d="m5 11 9 9"/>
</svg>
<span data-i18n="excl.toolErase">Erase</span>
</button>
</div>
<!-- Brush type switcher (shown only when Brush is active) -->
@@ -282,15 +272,15 @@
<label data-i18n="labels.type">Type</label>
<div class="excl-seg">
<button id="excl-brush-single" class="excl-seg-btn active" data-i18n="brushType.single">Single</button>
<button id="excl-brush-radius-btn" class="excl-seg-btn" data-i18n="brushType.radius">Radius</button>
<button id="excl-brush-radius-btn" class="excl-seg-btn" data-i18n="brushType.circle">Circle</button>
</div>
</div>
<!-- Radius slider (shown when Brush + Radius) -->
<div id="excl-radius-row" class="form-row slider-row hidden">
<label for="excl-brush-radius-slider" data-i18n="labels.radius">Radius</label>
<input type="range" id="excl-brush-radius-slider" min="0.1" max="50" step="0.1" value="5" />
<input type="number" class="val" id="excl-brush-radius-val" value="5" min="0.1" max="50" step="0.1" />
<label for="excl-brush-radius-slider" data-i18n="labels.size">Size</label>
<input type="range" id="excl-brush-radius-slider" min="0.2" max="100" step="0.2" value="10" />
<input type="number" class="val" id="excl-brush-radius-val" value="10" min="0.2" max="100" step="0.2" />
</div>
<!-- Bucket threshold (shown when Fill is active) -->
@@ -302,7 +292,8 @@
<!-- Footer: count + clear -->
<div class="excl-footer">
<span id="excl-count" class="excl-count">0 faces excluded</span>
<span id="excl-count" class="excl-count">0 faces masked</span>
<span id="excl-shift-hint" class="excl-shift-hint" data-i18n="excl.shiftHint">Hold Shift to erase</span>
<button id="excl-clear-btn" class="excl-clear-btn" data-i18n="ui.clearAll">Clear All</button>
</div>
</section>