really really good
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index d3e85f9..87cf35d 100644 (file)
@@ -233,7 +233,9 @@ public class Mesh implements Iterable<Mesh.T> {
         }
         public void computeError() {
             if (quadric_count == 0) {
-                if (nearest_in_other_mesh == null) {
+                if (!tilemesh) {
+                }
+                else if (nearest_in_other_mesh == null) {
                     if (score_against != null) {
                         Vert ne = score_against.nearest(p);
                         oldscore = ne.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
@@ -244,7 +246,7 @@ public class Mesh implements Iterable<Mesh.T> {
                     oldscore = nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
                 }
             } else {
-                oldscore = (quadric.preAndPostMultiply(p) * 100) / quadric_count;
+                oldscore = (quadric.preAndPostMultiply(p) * 100) /*/ quadric_count*/;
             }
 
             oldscore = oldscore;
@@ -255,18 +257,20 @@ public class Mesh implements Iterable<Mesh.T> {
             do {
                 double ang = Math.abs(e.crossAngle());
                 if (ang > Math.PI) throw new Error();
+                /*
                 if (e.t != null) {
                     numaspects++;
                     aspects += e.t.aspect()*e.t.aspect();
                 }
-
-                float minangle = (float)(Math.PI * 0.3);
+                */
+                /*
+                float minangle = (float)(Math.PI * 0.8);
                 if (ang > minangle)
                     oldscore += (ang - minangle);
-
+                */
                 e = e.pair.next;
             } while (e != this.e);
-            //if (numaspects > 0) oldscore += (aspects / numaspects);
+            if (numaspects > 0) oldscore += (aspects / numaspects);
 
             //System.out.println(oldscore);
             //oldscore = oldscore*oldscore;
@@ -805,5 +809,5 @@ public class Mesh implements Iterable<Mesh.T> {
             p3().glVertex(gl);
         }
     }
-
+    public boolean tilemesh = false;
 }