File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
main/java/eu/mihosoft/vrl/v3d
test/java/eu/mihosoft/vrl/v3d Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1159,7 +1159,9 @@ private CSG _unionNoOpt(CSG csg) {
11591159 */
11601160 public CSG difference (List <CSG > csgs ) {
11611161 if (CSGClient .isRunning ()) {
1162- ArrayList <CSG > go = new ArrayList <CSG >(csgs );
1162+ ArrayList <CSG > go = new ArrayList <CSG >();
1163+ go .add (this );
1164+ go .addAll (csgs );
11631165 try {
11641166 return CSGClient .getClient ().difference (go ).get (0 );
11651167 } catch (Exception e ) {
Original file line number Diff line number Diff line change @@ -53,13 +53,15 @@ public CSG prep(CSG incoming) {
5353 b .getBounds ();
5454 CSG c = new Cube (10 , 10 , 10 ).toCSG ();
5555 c .getBounds ();
56+ CSG dif = new Cube (100 , 100 , 1 ).toCSG ();
57+ dif .getBounds ();
5658
5759 int apoly1 = a .getPolygons ().size ();
5860 int bpoly1 =b .getPolygons ().size ();
5961
6062 CSG u1 = a .union ( b ,c );
6163 CSG i1 = c .intersect (b );
62- CSG d1 = a .difference (b );
64+ CSG d1 = a .difference (b , dif );
6365 CSG t1 = d1 .clone ().triangulate (true );
6466 ArrayList <CSG > m1 = a .minkowskiHullShape (b );
6567 CSG h1 = u1 .hull ();
@@ -77,7 +79,7 @@ public CSG prep(CSG incoming) {
7779 CSG i0 = c .intersect (b );
7880 if (testPoly (i1 ,i0 ))
7981 fail ();
80- CSG d = a .difference (b );
82+ CSG d = a .difference (b , dif );
8183 if (testPoly (d1 ,d ))
8284 fail ("Difference Step fail , expected " +d1 .getPolygons ().size ()+" got " +d .getPolygons ().size ());
8385 CSG t = d .clone ().triangulate (true );
You can’t perform that action at this time.
0 commit comments