checkpoint
authoradam <adam@megacz.com>
Wed, 5 Dec 2007 07:40:37 +0000 (23:40 -0800)
committeradam <adam@megacz.com>
Wed, 5 Dec 2007 07:40:37 +0000 (23:40 -0800)
darcs-hash:20071205074037-5007d-89a2ce97ab70beb5bb49bc0069667eb9b52a1dbe.gz

src/edu/berkeley/qfat/Main.java
src/edu/berkeley/qfat/Mesh.java

index bb15b3b..0246692 100644 (file)
@@ -31,7 +31,6 @@ public class Main extends MeshViewer {
         // rotate to align major axis -- this probably needs to be done by a human.
         goal.transform(new Matrix(new Vec(0, 0, 1), (float)(Math.PI/2)));
 
         // rotate to align major axis -- this probably needs to be done by a human.
         goal.transform(new Matrix(new Vec(0, 0, 1), (float)(Math.PI/2)));
 
-
         float goal_width  = goal.diagonal().dot(new Vec(1, 0, 0));
         float goal_height = goal.diagonal().dot(new Vec(0, 1, 0));
         float goal_depth  = goal.diagonal().dot(new Vec(0, 0, 1));
         float goal_width  = goal.diagonal().dot(new Vec(1, 0, 0));
         float goal_height = goal.diagonal().dot(new Vec(0, 1, 0));
         float goal_depth  = goal.diagonal().dot(new Vec(0, 0, 1));
@@ -222,15 +221,13 @@ public class Main extends MeshViewer {
         }
     }
 
         }
     }
 
-
     public static int verts = 0;
     public static int verts = 0;
+
     public void anneal() throws Exception {
         int verts = 0;
         while(true) {
     public void anneal() throws Exception {
         int verts = 0;
         while(true) {
-            //Thread.sleep(10);
             for(int i=0; i<1; i++) {
                 repaint();
             for(int i=0; i<1; i++) {
                 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.v1(), t.v2(), t.v3() }) {
                         rand(10,p);
                 for(Mesh.T t : tile)
                     for(Mesh.Vert p : new Mesh.Vert[] { t.v1(), t.v2(), t.v3() }) {
                         rand(10,p);
@@ -244,7 +241,6 @@ public class Main extends MeshViewer {
             }
             breakit();
        }
             }
             breakit();
        }
-
     }
 
     public static void main(String[] s) throws Exception {
     }
 
     public static void main(String[] s) throws Exception {
index b25d1b7..f96346d 100644 (file)
@@ -215,15 +215,7 @@ public class Mesh implements Iterable<Mesh.T> {
                 }
             }
 
                 }
             }
 
-            /*
-            double s1, s2;
-            if (quadric_count==0) s1 = 0;
-            else                  s1 = p.distance(quadric_x/quadric_count, quadric_y/quadric_count, quadric_z/quadric_count);
-            s2 = quadric==null ? 0 : po.p.distance(quadric.p);
-            oldscore = (float)(s1 + s2);
-            */
             oldscore = quadric_count == 0 ? 0 : (quadric.preAndPostMultiply(p) / quadric_count);
             oldscore = quadric_count == 0 ? 0 : (quadric.preAndPostMultiply(p) / quadric_count);
-
             score += oldscore;
         }
 
             score += oldscore;
         }
 
@@ -241,34 +233,11 @@ public class Mesh implements Iterable<Mesh.T> {
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
-            fundamentalQuadric = fundamentalQuadric();
             rescore();
 
             rescore();
 
-            // recompute fundamental quadrics of all vertices sharing a face
-            /*
-            E e = this.e;
-            do {
-                e.p2.recomputeFundamentalQuadric();
-                e = e.pair.next;
-            } while(e != this.e);
-            */
-            
-            boolean good = true;
-            /*
-            for(T t : this) {
-                for(E e = this.e; ;) {
-                    if (e.intersects(t)) { good = false; break; }
-                    e = e.pair.next;
-                    if (e == this.e) break;
-                }
-            }
-            */
-            /*
-                if (t==this.t) continue;
-                if (this.intersects(t)) good = false;
-            }
-            */
-            return good;
+            // should recompute fundamental quadrics of all vertices sharing a face, but we defer...
+            // FIXME: intersection test needed?
+            return true;
         }
         public boolean move(Vec v) {
             Matrix m = new Matrix(v);
         }
         public boolean move(Vec v) {
             Matrix m = new Matrix(v);