checkpoint
[anneal.git] / src / edu / berkeley / qfat / Main.java
index 9ba230d..2788f02 100644 (file)
@@ -184,23 +184,23 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
                 for(Mesh.T t2 : tile) {
                     if (t1==t2) continue;
 
-                    if ((t1.p1().p.times(m).minus(t2.p1().p).mag() < Mesh.EPSILON) &&
-                        (t1.p2().p.times(m).minus(t2.p3().p).mag() < Mesh.EPSILON) &&
-                        (t1.p3().p.times(m).minus(t2.p2().p).mag() < Mesh.EPSILON)) {
+                    if ((t1.v1().p.times(m).minus(t2.v1().p).mag() < Mesh.EPSILON) &&
+                        (t1.v2().p.times(m).minus(t2.v3().p).mag() < Mesh.EPSILON) &&
+                        (t1.v3().p.times(m).minus(t2.v2().p).mag() < Mesh.EPSILON)) {
                         t1.e1().bind(t2.e3().pair);
                         t1.e2().bind(t2.e2().pair);
                         t1.e3().bind(t2.e1().pair);
                     }
-                    if ((t1.p2().p.times(m).minus(t2.p1().p).mag() < Mesh.EPSILON) &&
-                        (t1.p3().p.times(m).minus(t2.p3().p).mag() < Mesh.EPSILON) &&
-                        (t1.p1().p.times(m).minus(t2.p2().p).mag() < Mesh.EPSILON)) {
+                    if ((t1.v2().p.times(m).minus(t2.v1().p).mag() < Mesh.EPSILON) &&
+                        (t1.v3().p.times(m).minus(t2.v3().p).mag() < Mesh.EPSILON) &&
+                        (t1.v1().p.times(m).minus(t2.v2().p).mag() < Mesh.EPSILON)) {
                         t1.e2().bind(t2.e3().pair);
                         t1.e3().bind(t2.e2().pair);
                         t1.e1().bind(t2.e1().pair);
                     }
-                    if ((t1.p3().p.times(m).minus(t2.p1().p).mag() < Mesh.EPSILON) &&
-                        (t1.p1().p.times(m).minus(t2.p3().p).mag() < Mesh.EPSILON) &&
-                        (t1.p2().p.times(m).minus(t2.p2().p).mag() < Mesh.EPSILON)) {
+                    if ((t1.v3().p.times(m).minus(t2.v1().p).mag() < Mesh.EPSILON) &&
+                        (t1.v1().p.times(m).minus(t2.v3().p).mag() < Mesh.EPSILON) &&
+                        (t1.v2().p.times(m).minus(t2.v2().p).mag() < Mesh.EPSILON)) {
                         t1.e3().bind(t2.e3().pair);
                         t1.e1().bind(t2.e2().pair);
                         t1.e2().bind(t2.e1().pair);
@@ -243,7 +243,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
         //double min = (tile.avgedge/tile.numedges)*(1+(4/(double)verts));
         //if (verts>0 && tile.es.peek().length() < min) return;
         PriorityQueue<Mesh.E> es = new PriorityQueue<Mesh.E>();
-        for(Mesh.E e : tile.es) es.add(e);
+        for(Mesh.E e : tile.edges()) es.add(e);
         for(int i=0; i<10; i++) {
             Mesh.E e = es.poll();
             verts++;
@@ -408,7 +408,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
             */
 
             if (mesh==goal)
-                for(Mesh.Vert p : new Mesh.Vert[] { t.p1(), t.p2(), t.p3() }) {
+                for(Mesh.Vert p : new Mesh.Vert[] { t.v1(), t.v2(), t.v3() }) {
                     p.p.glVertex(gl);
                     //p.plus(p.norm().times(p.score()*10)).glVertex(gl);
                     p.partner().p.glVertex(gl);
@@ -450,7 +450,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
                 glcanvas.repaint();
                 //tile.ts.get(Math.abs(random.nextInt()) % tile.ts.size()).e1().p1
                 for(Mesh.T t : tile)
-                    for(Mesh.Vert p : new Mesh.Vert[] { t.p1(), t.p2(), t.p3() }) {
+                    for(Mesh.Vert p : new Mesh.Vert[] { t.v1(), t.v2(), t.v3() }) {
                         rand(10,p);
                     }
                 goal.rescore();