X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=48fb47bb8929f27dccf326e51dd38306f3c7c609;hp=4ee9fa18ffb5e97f38d3f01f193a8c791ee391f8;hb=d0a170a80133a2d71ea35fd427fc7f97643564da;hpb=134533b4f701c44cf69b2c08bedf4ae7b5beba0b 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);