From: adam Date: Sun, 16 Dec 2007 02:09:51 +0000 (-0800) Subject: checkpoint X-Git-Url: http://git.megacz.com/?p=anneal.git;a=commitdiff_plain;h=d0a170a80133a2d71ea35fd427fc7f97643564da checkpoint darcs-hash:20071216020951-5007d-345a088201f6f54aa3b3535522b8e4a8990fd5fb.gz --- diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index 4ee9fa1..48fb47b 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -277,38 +277,30 @@ public class Mesh implements Iterable { /** 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);