checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index 60aa9ab..b6ff386 100644 (file)
@@ -355,10 +355,15 @@ public class Mesh implements Iterable<Mesh.T> {
             return e.comparator() > comparator() ? 1 : -1;
         }
         public void bindEdge(E e, Matrix m) {
+            _bindEdge(e, m);
+            pair._bindEdge(e.pair, m);
+        }
+        public void _bindEdge(E e, Matrix m) {
             //bind_to.add(e);
 
-            //assumes edges are identical length at binding time
             e = e.pair;
+            /*
+            //assumes edges are identical length at binding time
             Vec reflectionPlaneNormal = e.p2.p.minus(e.p1.p).norm();
             float a = reflectionPlaneNormal.x;
             float b = reflectionPlaneNormal.y;
@@ -368,14 +373,13 @@ public class Mesh implements Iterable<Mesh.T> {
                             -2*a*b,  1-2*b*b,  -2*b*c, 0,
                             -2*a*c,   -2*b*c, 1-2*c*c, 0,
                             0,       0,       0,       1);
-            /*
             m = m.times(Matrix.translate(e.midpoint().minus(Point.ORIGIN))
                         .times(reflectionMatrix)
                         .times(Matrix.translate(Point.ORIGIN.minus(e.midpoint()))));
-            */
             System.out.println(reflectionPlaneNormal);
             System.out.println("  " + p1.p + " " + m.times(e.p1.p));
             System.out.println("  " + p2.p + " " + m.times(e.p2.p));
+            */
             if (m.times(e.p1.p).minus(p1.p).mag() > EPSILON) throw new Error();
             if (m.times(e.p2.p).minus(p2.p).mag() > EPSILON) throw new Error();
             this.bindTo(m, e);