feat: implement surface exclusion mode toggle and enhance exclusion overlay logic

This commit is contained in:
CNCKitchen
2026-03-17 19:43:46 +01:00
parent cbe7e7ffef
commit 598902021a
6 changed files with 197 additions and 32 deletions
+5 -3
View File
@@ -262,7 +262,7 @@ export function getCurrentMesh() { return currentMesh; }
*
* @param {THREE.BufferGeometry|null} overlayGeo
*/
export function setExclusionOverlay(overlayGeo) {
export function setExclusionOverlay(overlayGeo, color = 0xff6600, opacity = 1.0) {
if (exclusionMesh) {
scene.remove(exclusionMesh);
exclusionMesh.geometry.dispose();
@@ -272,9 +272,11 @@ export function setExclusionOverlay(overlayGeo) {
if (!overlayGeo || overlayGeo.attributes.position.count === 0) return;
exclusionMesh = new THREE.Mesh(
overlayGeo,
new THREE.MeshBasicMaterial({
color: 0xff6600,
new THREE.MeshLambertMaterial({
color,
side: THREE.DoubleSide,
transparent: opacity < 1.0,
opacity,
polygonOffset: true,
polygonOffsetFactor: -1,
polygonOffsetUnits: -1,