File tree Expand file tree Collapse file tree
src/main/java/eu/mihosoft/vrl/v3d Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ public CSG processPolygonsToTriangles(ArrayList<Polygon> polygons) throws Coline
341341 */
342342 private static int intern (Vertex v , Map <String , Integer > index , List <Vector3d > list ) {
343343
344- double precision = 0.0001 ;// 0.1d/Plane.getEPSILON();
344+ double precision = 1.0d / POINTS_CONTACT_DISTANCE ;//0.1d/Plane.getEPSILON();
345345
346346 long x = Math .round (v .pos .x * precision );
347347 long y = Math .round (v .pos .y * precision );
@@ -1896,6 +1896,8 @@ public StringBuilder toStlString(StringBuilder sb) {
18961896 // }
18971897
18981898 public CSG makeManifold () throws ColinearPointsException {
1899+ if (getNumberOfTriangles ()<4 )
1900+ return this ;
18991901 // if (fix && needsDegeneratesPruned)
19001902 // triangulated = false;
19011903 // if (triangulated)
@@ -1925,12 +1927,12 @@ public CSG makeManifold() throws ColinearPointsException {
19251927
19261928 ArrayList <Polygon > polygons = generatePolygonsFromMesh ();
19271929 do {
1928- long np = vertCount ;
19291930 long numberOfPolygons = getNumberOfTriangles ();
1931+ long np = numberOfPolygons *3 ;
19301932
19311933 int extraSpace = ExtraSpace ;
19321934 long longLength = 1 + np + ((numberOfPolygons + 1 ) * extraSpace );
1933- if (longLength * 4 > Integer .MAX_VALUE )
1935+ if (longLength > Integer .MAX_VALUE )
19341936 new RuntimeException ("Mesh too large to process with integers!" ).printStackTrace ();
19351937 else {
19361938 System .err .println ("Processing Mesh Manifold with " + longLength * 4 + " byte buffer" );
You can’t perform that action at this time.
0 commit comments