]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Allow tube shape to handle shorter distances. 65/4665/1 release/1.43.1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Fri, 26 Feb 2021 15:16:43 +0000 (17:16 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Fri, 26 Feb 2021 15:16:43 +0000 (17:16 +0200)
gitlab #40

Change-Id: Ifdbd06d9b5e85afeab88593f2b77160efa4e6189

org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java

index a3c9dd192f085d201a76c6c9536074bb0cb3e422..64cf8f35f869c139895482f3d9f2b64a45e4a4ba 100644 (file)
@@ -73,7 +73,7 @@ public class Tube {
                for (int i = 0; i < vertices.size() - 1; i++) {
                        t.set(vertices.get(i+1));
                        t.sub(vertices.get(i));
-                       if (t.lengthSquared() < 0.0000001)
+                       if (t.lengthSquared() < MathTools.NEAR_ZERO)
                                throw new IllegalArgumentException("vertices at index " + i + " are too close to each other");
                }
                }