From 5c7b1ca585cb4cee07de97b2ea3608f1fb5de3e9 Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Fri, 26 Feb 2021 17:16:43 +0200 Subject: [PATCH] Allow tube shape to handle shorter distances. gitlab #40 Change-Id: Ifdbd06d9b5e85afeab88593f2b77160efa4e6189 --- org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); } } -- 2.45.2