From 2e674f67b2f33123584f8fcf714239faddc21592 Mon Sep 17 00:00:00 2001 From: CNCKitchen Date: Mon, 6 Apr 2026 14:23:44 +0200 Subject: [PATCH] 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. --- js/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index c83cb51..4594127 100644 --- a/js/main.js +++ b/js/main.js @@ -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)));