Skip to content

Commit

Permalink
fix: csg color loss for non-intersecting union (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeng03 authored Mar 12, 2024
1 parent fcb0402 commit 5d762b0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion patches/@jscad+modeling+2.9.6.patch
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ index cf9c591..af1842c 100644
}

diff --git a/node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js b/node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js
index a4026e3..3dc6158 100644
index a4026e3..2ac0689 100644
--- a/node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js
+++ b/node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js
@@ -14,8 +14,8 @@ const unionSub = (geometry1, geometry2) => {
Expand All @@ -236,3 +236,14 @@ index a4026e3..3dc6158 100644

a.clipTo(b, false)
// b.clipTo(a, true); // ERROR: doesn't work
@@ -32,8 +32,8 @@ const unionSub = (geometry1, geometry2) => {
// Like union, but when we know that the two solids are not intersecting
// Do not use if you are not completely sure that the solids do not intersect!
const unionForNonIntersecting = (geometry1, geometry2) => {
- let newpolygons = geom3.toPolygons(geometry1)
- newpolygons = newpolygons.concat(geom3.toPolygons(geometry2))
+ let newpolygons = geom3.toPolygons(geometry1, true)
+ newpolygons = newpolygons.concat(geom3.toPolygons(geometry2, true))
return geom3.create(newpolygons)
}

0 comments on commit 5d762b0

Please sign in to comment.