public class Mesh implements Iterable<Mesh.T> {
- public static float EPSILON = (float)0.0001;
- public static Random random = new Random();
+ public static final float EPSILON = (float)0.0001;
+ public static final Random random = new Random();
private PointSet<Vert> pointset = new PointSet<Vert>();
return (float)total;
}
-
public class BindingGroup {
public HashSet<E> es = new HashSet<E>();
public BindingGroup() { }
float oldscore = 0;
boolean inserted = false;
+ public Matrix quadric() {
+ Matrix m = new Matrix(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+ E e = this.e;
+ do {
+ T t = e.t;
+ m = m.plus(t.norm().fundamentalQuadric(t.centroid()));
+ e = e.pair.next;
+ } while(e != this.e);
+ return m;
+ }
+
public Point getPoint() { return p; }
private Vert(Point p) {
this.p = p;
- //this.e = e;
- //if (e==null) throw new Error();
if (pointset.get(p) != null) throw new Error();
pointset.add(this);
}
/** does NOT update bound pairs! */
public boolean transform(Matrix m) {
- // FIXME: screws up kdtree
- // FIXME: screws up hashmap
unscore();
try {
if (pointset.get(this.p)==null) throw new Error();
float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h;
float newz = m.i*p.x + m.j*p.y + m.k*p.z + m.l;
this.p = new Point(newx, newy, newz);
- // FIXME: what if we move onto exactly where another point is?
pointset.add(this);
} catch (Exception e) {
throw new RuntimeException(e);
E next; // next half-edge
E pair; // partner half-edge
public BindingGroup bg = new BindingGroup(this);
+ boolean shattered = false;
public int compareTo(E e) { return e.length() > length() ? 1 : -1; }
}
}
- boolean shattered = false;
public Point shatter() { return shatter(midpoint(), null, null); }
public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2) {
if (shattered) return mid;