fix(preview): set boundary falloff to 0 at boundary vertices

Boundary vertices (shared between masked and unmasked faces) were
skipped during falloff computation, keeping their falloffAttr at 1.0.
This created a ring of full-intensity texture at the mask border before
the falloff gradient started. Now these vertices correctly get factor 0
(distance to boundary = 0), matching the export behavior.
This commit is contained in:
CNCKitchen
2026-04-06 14:23:44 +02:00
parent 47cc55e5ce
commit 2e674f67b2
+4 -1
View File
@@ -1649,7 +1649,10 @@ function computeBoundaryFalloffAttr(geometry, userMaskArr) {
for (const [k, pos] of posFromKey) {
const mf = maskFracMap.get(k);
const frac = mf[1] > 0 ? mf[0] / mf[1] : 0;
if (frac > 0) continue; // masked or boundary vertex — keep 1.0 (mask handles it)
if (frac >= 1) continue; // fully masked vertex — keep 1.0 (mask zeroes it anyway)
// Boundary vertices (shared between masked and unmasked faces) are AT
// the boundary → distance 0 → falloff factor 0.
if (frac > 0) { falloffCache.set(k, 0); continue; }
const px = pos[0], py = pos[1], pz = pos[2];
const cix = Math.max(0, Math.min(gRes - 1, Math.floor((px - gMinX) / gDx)));