checkpoint
authoradam <adam@megacz.com>
Sun, 16 Dec 2007 02:09:51 +0000 (18:09 -0800)
committeradam <adam@megacz.com>
Sun, 16 Dec 2007 02:09:51 +0000 (18:09 -0800)
darcs-hash:20071216020951-5007d-345a088201f6f54aa3b3535522b8e4a8990fd5fb.gz

src/edu/berkeley/qfat/Mesh.java

index 4ee9fa1..48fb47b 100644 (file)
@@ -277,38 +277,30 @@ public class Mesh implements Iterable<Mesh.T> {
         /** does NOT update bound pairs! */
         public boolean transform(Matrix m) {
             if (immutableVertices) throw new Error();
+
             unApplyQuadricToNeighbor();
             Point oldp = this.p;
-            try {
-                if (vertices.get(this.p)==null) throw new Error();
-                vertices.remove(this);
-                removeTrianglesFromRTree();
-                float newx = m.a*p.x + m.b*p.y + m.c*p.z + m.d;
-                float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h;
-                float newz = m.i*p.x + m.j*p.y + m.k*p.z + m.l;
-                this.p = new Point(newx, newy, newz);
-                addTrianglesToRTree();
-                vertices.add(this);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+
+            if (vertices.get(this.p)==null) throw new Error();
+            vertices.remove(this);
+            removeTrianglesFromRTree();
+            float newx = m.a*p.x + m.b*p.y + m.c*p.z + m.d;
+            float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h;
+            float newz = m.i*p.x + m.j*p.y + m.k*p.z + m.l;
+            this.p = new Point(newx, newy, newz);
+            addTrianglesToRTree();
+            vertices.add(this);
+
             applyQuadricToNeighbor();
 
-            // FIXME: intersection test needed?
             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;
-                  }
-                */
+                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;
+                // should recompute fundamental quadrics of all vertices sharing a face, but we defer...
                 e.p2.quadricStale = true;
                 e = e.pair.next;
             } while(e != this.e);