checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index c563563..42f03d2 100644 (file)
@@ -109,25 +109,6 @@ public class Mesh implements Iterable<Mesh.T> {
             fundamentalQuadric = m.times(1/(float)count);
         }
 
             fundamentalQuadric = m.times(1/(float)count);
         }
 
-        public void applyQuadricToNeighbor() {
-            if (score_against == null) return;
-
-            Vertex new_nearest = (Vertex)nearest();
-            if (nearest_in_other_mesh != null && new_nearest == nearest_in_other_mesh) return;
-
-            if (nearest_in_other_mesh != null) unApplyQuadricToNeighbor();
-            if (nearest_in_other_mesh != null) throw new Error();
-
-            nearest_in_other_mesh = new_nearest;
-                
-            nearest_in_other_mesh.unComputeError();
-            nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.plus(fundamentalQuadric());
-            nearest_in_other_mesh.quadric_count++;
-            nearest_in_other_mesh.computeError();
-
-            reComputeError();
-        }
-
         public void reComputeErrorAround() {
             reComputeError();
             if (nearest_in_other_mesh != null) nearest_in_other_mesh.reComputeError();
         public void reComputeErrorAround() {
             reComputeError();
             if (nearest_in_other_mesh != null) nearest_in_other_mesh.reComputeError();
@@ -142,7 +123,10 @@ public class Mesh implements Iterable<Mesh.T> {
             score -= oldscore;
             oldscore = 0;
         }
             score -= oldscore;
             oldscore = 0;
         }
-        public HasQuadric nearest() { return score_against.vertices.nearest(p, this); }
+        public HasQuadric nearest() {
+            if (score_against==null) return null;
+            return score_against.vertices.nearest(p, this);
+        }
         public void computeError() {
             oldscore =
                 quadric_count != 0
         public void computeError() {
             oldscore =
                 quadric_count != 0