From: Marko Luukkainen Date: Fri, 26 Feb 2021 15:16:43 +0000 (+0200) Subject: Allow tube shape to handle shorter distances. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Frelease%2F1.43.1;p=simantics%2F3d.git Allow tube shape to handle shorter distances. gitlab #40 Change-Id: Ifdbd06d9b5e85afeab88593f2b77160efa4e6189 --- diff --git a/org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java b/org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java index a3c9dd19..64cf8f35 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java +++ b/org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java @@ -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"); } }