public float error() { return (float)error; }
public int size() { return vertices.size(); }
+ public int numTriangles() { return triangles.size(); }
public Iterable<Vertex> vertices() { return vertices; }
public Iterator<T> iterator() { return triangles.iterator(); }
bindEdge(e, m);
}
public void bindEdge(E e, Matrix m) {
+ /*
for(E e_ : (Iterable<E>)e.getBoundPeers()) {
if (e.v1.getPoint().distance((e.getBindingMatrix(e_).times(e_.v1.getPoint()))) > 0.01f)
throw new RuntimeException("blah! " + e.v1.getPoint() + " " + e.getBindingMatrix(e_).times(e_.v1.getPoint()));
if (v2.getPoint().distance(m.times(e.getBindingMatrix(e_).times(e_.v2.getPoint()))) > 0.01f)
throw new RuntimeException("blah! " + v2.getPoint() + " " + m.times(e_.v2.getPoint()));
}
+ */
this.bindTo(m, e, EPSILON);
this.pair.bindTo(m, e.pair, EPSILON);
}
public E(Point v1, Point v2) {
if (vertices.get(v1) != null) throw new Error();
if (vertices.get(v2) != null) throw new Error();
+ if (v1.equals(v2)) throw new Error("attempt to create a zero-length edge!");
this.v1 = new Vertex(v1);
this.v2 = new Vertex(v2);
this.prev = this.next = this.pair = new E(this, this, this);
public T newT(HasPoint v1, HasPoint v2, HasPoint v3) {
return newT(v1.getPoint(), v2.getPoint(), v3.getPoint(), null, 0);
}
+ public T newT(Point v1, Point v2, Point v3, Vec norm) { return newT(v1, v2, v3, norm, 1); }
public T newT(Point v1, Point v2, Point v3, Vec norm, int colorclass) {
if (coalesce) {