checkpoint
authoradam <adam@megacz.com>
Mon, 17 Dec 2007 23:26:22 +0000 (15:26 -0800)
committeradam <adam@megacz.com>
Mon, 17 Dec 2007 23:26:22 +0000 (15:26 -0800)
darcs-hash:20071217232622-5007d-b0ae842a4907be2e74bad1483333648cfb241591.gz

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

index 0c8c271..83bf281 100644 (file)
@@ -86,12 +86,12 @@ public class Main extends MeshViewer {
         float halfup = 0;
 
         translations = new Matrix[] {
-            /*
+
             Matrix.translate(new Vec(lshift,  depth,    halfup)),
             Matrix.translate(new Vec(rshift,  depth,    halfup)),
             Matrix.translate(new Vec(lshift, -depth,    halfup)),
             Matrix.translate(new Vec(rshift, -depth,    halfup)),
-            */
+
             /*
               Matrix.translate(new Vec(0,  depth,    halfup)),
               Matrix.translate(new Vec(0, -depth,    halfup)),
index 02f589e..edd82d6 100644 (file)
@@ -313,9 +313,9 @@ public class Mesh implements Iterable<Mesh.T> {
                 e.p2.bind(ebound.p1);
             }
         }
-        public void shatter(BindingGroup bg1, BindingGroup bg2) {
+        public void shatter(BindingGroup bg1, BindingGroup bg2, boolean triangles) {
             for(E e : set) {
-                e.shatter(e.midpoint(), bg1, bg2);
+                e.shatter(e.midpoint(), bg1, bg2, triangles);
             }
         }
     }
@@ -354,8 +354,8 @@ public class Mesh implements Iterable<Mesh.T> {
         public void bindEdge(E e) { bind_to.add(e); }
         public void dobind() { bind_to.dobind(this); }
 
-        public Point shatter() { return shatter(midpoint(), null, null); }
-        public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2) {
+        public Point shatter() { return shatter(midpoint(), null, null, true); }
+        public Point shatter(Point mid, BindingGroup bg1, BindingGroup bg2, boolean triangles) {
             if (shattered || destroyed) return mid;
             shattered = true;
 
@@ -367,15 +367,17 @@ public class Mesh implements Iterable<Mesh.T> {
             if (bg1==null) bg1 = new BindingGroup();
             if (bg2==null) bg2 = new BindingGroup();
             BindingGroup old_bind_to = bind_to;
-            bind_peers.shatter(bg1, bg2);
-            old_bind_to.shatter(bg2.other(), bg1.other());
+            bind_peers.shatter(bg1, bg2, triangles);
+            old_bind_to.shatter(bg2.other(), bg1.other(), triangles);
             pair.shatter();
             destroy();
 
-            newT(r.p, p1.p, mid, null, old_colorclass);
-            newT(r.p, mid, p2.p, null, old_colorclass);
-            bg1.add(p1.getE(mid));
-            bg2.add(p2.getE(mid).pair);
+            if (triangles) {
+                newT(r.p, p1.p, mid, null, old_colorclass);
+                newT(r.p, mid, p2.p, null, old_colorclass);
+                bg1.add(p1.getE(mid));
+                bg2.add(p2.getE(mid).pair);
+            }
             return mid;
         }