Skip to content

Commit f3572bb

Browse files
committed
Update the slicing engine
1 parent 181f566 commit f3572bb

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/com/neuronrobotics/manifold3d/CSGManifold3d.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ public CSG fromManifold(MemorySegment ms, Color c) throws Throwable {
124124
* @throws RuntimeException
125125
* wrapping any native call failure
126126
*/
127-
public ArrayList<Polygon> sliceAtZero(CSG incoming, Transform slicePlane) throws Throwable {
127+
public ArrayList<Polygon> sliceAtZero(CSG incoming, Transform slicePlane, double offset) throws Throwable {
128128
CSG csg = incoming.transformed(slicePlane.inverse());
129129
MemorySegment csgm = null;
130130
try {
131131
csgm = toManifold(csg);
132132
checkResult(csgm);
133-
List<double[][]> contours = manifold.slice(csgm, 0.0);
133+
List<double[][]> contours = manifold.sliceWithOffset(
134+
csgm, 0.0, offset, ManifoldBindings.JoinType.ROUND, 2.0, 0);
134135

135136
ArrayList<Polygon> result = new ArrayList<>(contours.size());
136137

src/main/java/eu/mihosoft/vrl/v3d/CSG.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,7 @@ public static void setDefaultOptType(OptType optType) {
28272827
public List<Polygon> slice(CSG incoming, Transform slicePlane, double normalInsetDistance)
28282828
throws ColinearPointsException {
28292829
try {
2830-
return getManifold().sliceAtZero(incoming, slicePlane);
2830+
return getManifold().sliceAtZero(incoming, slicePlane,normalInsetDistance);
28312831
} catch (Throwable e) {
28322832
System.err.println("Slice failed on manifold, using legacy slice");
28332833
e.printStackTrace();

0 commit comments

Comments
 (0)