checkpoint
[anneal.git] / src / edu / berkeley / qfat / Main.java
index 0ff0dcf..f32258d 100644 (file)
@@ -272,7 +272,11 @@ public class Main extends MeshViewer {
         int oldverts = verts;
         System.out.println("doubling vertices.");
         PriorityQueue<Mesh.E> es = new PriorityQueue<Mesh.E>();
-        for(Mesh.E e : tile.edges()) es.add(e);
+        for(Mesh.T t : tile) {
+            es.add(t.e1());
+            es.add(t.e2());
+            es.add(t.e3());
+        }
         for(int i=0; i<oldverts; i++) {
             Mesh.E e = es.poll();
             verts++;
@@ -394,7 +398,7 @@ public class Main extends MeshViewer {
             System.out.println("temp="+temp + " ratio="+(Math.ceil(ratio*100)) + " " +
                                "points_per_second=" +
                                (count*1000)/((double)(System.currentTimeMillis()-then)));
-            tile.rebuildPointSet();
+            tile.rebuild();
             repaint();
             //breakit();
             repaint();
@@ -403,10 +407,14 @@ public class Main extends MeshViewer {
             tile.recomputeAllFundamentalQuadrics();
             repaint();
             goal.applyQuadricToNeighborAll();
+
+            safeTriangles.clear();
+            for(Mesh.T t : tile) if (t.shouldBeDrawn()) safeTriangles.add(t);
             }
        }
     }
 
+
     public static void main(String[] s) throws Exception {
         StlFile stlf = new StlFile();
         stlf.load("fish.stl");