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;
int iv = c*resolution + s;
/*
- iv+1 ---- iv + resolution + 1
- | /|
- |/ |
+ iv+1 ---- iv + resolution + 1
+ | /|
+ |/ |
iv ---- iv + resolution
*/
if (s < resolution - 1) {