mirror of
https://github.com/CNCKitchen/stlTexturizer.git
synced 2026-04-07 22:11:32 +00:00
feat: implement surface exclusion mode toggle and enhance exclusion overlay logic
This commit is contained in:
+5
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user