]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/shape/Tube.java
Remove dependencies on log4j
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / shape / Tube.java
index dc7ff4e5270a31c0707df36e02a4531556781989..a3c9dd192f085d201a76c6c9536074bb0cb3e422 100644 (file)
@@ -69,11 +69,13 @@ public class Tube {
                
                Vector3d t = new Vector3d();
                
-               for (int i = 0; i < vertices.size() - 1; i++) {
-                       t.set(vertices.get(i+1));
-                       t.sub(vertices.get(i));
-                       if (t.lengthSquared() < 0.000001)
-                               throw new IllegalArgumentException("vertices at index " + i + " are too close to each other");
+               if (tangents == null) {
+               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)
+                               throw new IllegalArgumentException("vertices at index " + i + " are too close to each other");
+               }
                }
                
                int vcount = vertices.size()*resolution;