checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index 264e379..1d4967f 100644 (file)
@@ -15,7 +15,7 @@ public class Mesh implements Iterable<Mesh.T> {
     public static final Random random = new Random();
 
     private PointSet<Vert> pointset = new PointSet<Vert>();
-
+    public int size() { return pointset.size(); }
     public Iterable<Vert> vertices() { return pointset; }
 
     public Iterable<E> edges() {
@@ -265,11 +265,11 @@ public class Mesh implements Iterable<Mesh.T> {
                     aspects += e.t.aspect()*e.t.aspect();
                 }
                 */
-                /*
-                float minangle = (float)(Math.PI * 0.9);
+
+                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);
@@ -295,16 +295,25 @@ public class Mesh implements Iterable<Mesh.T> {
             }
             applyQuadricToNeighbor();
 
+            // FIXME: intersection test needed?
+            boolean good = true;
+
             // should recompute fundamental quadrics of all vertices sharing a face, but we defer...
             E e = this.e;
             do {
+                /*
+                if (Math.abs(e.crossAngle()) > (Math.PI * 0.9) ||
+                    Math.abs(e.next.crossAngle()) > (Math.PI * 0.9)) {
+                    good = false;
+                }
+                if (e.t.aspect() < 0.1) {
+                    good = false;
+                }
+                */
                 e.p2.quadricStale = true;
                 e = e.pair.next;
             } while(e != this.e);
 
-            // FIXME: intersection test needed?
-            boolean good = true;
-
             if (!ignorecollision)
             for(T t : Mesh.this) {
                 if (!good) break;
@@ -472,6 +481,7 @@ public class Mesh implements Iterable<Mesh.T> {
             return length()*t.area();
             */
             return (float)Math.max(length(), midpoint().distance(nearest.p));
+            //return length();
         }
         public int compareTo(E e) {
             return e.comparator() > comparator() ? 1 : -1;