X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=1d4967fe1bd76e279e2a0393ae133a7d2ebaef57;hp=264e379d1e01ce2b2befa23ebe07f55a71dc03a1;hb=57376a862c00fa1c8731f9989085fcfceeee0370;hpb=20989b5562ed9a4b438db2da8a4c2c3b9a05801d diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index 264e379..1d4967f 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -15,7 +15,7 @@ public class Mesh implements Iterable { public static final Random random = new Random(); private PointSet pointset = new PointSet(); - + public int size() { return pointset.size(); } public Iterable vertices() { return pointset; } public Iterable edges() { @@ -265,11 +265,11 @@ public class Mesh implements Iterable { aspects += e.t.aspect()*e.t.aspect(); } */ - /* - float minangle = (float)(Math.PI * 0.9); + + float minangle = (float)(Math.PI * 0.8); if (ang > minangle) oldscore += (ang - minangle); - */ + e = e.pair.next; } while (e != this.e); if (numaspects > 0) oldscore += (aspects / numaspects); @@ -295,16 +295,25 @@ public class Mesh implements Iterable { } applyQuadricToNeighbor(); + // FIXME: intersection test needed? + boolean 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; + } + */ e.p2.quadricStale = true; e = e.pair.next; } while(e != this.e); - // FIXME: intersection test needed? - boolean good = true; - if (!ignorecollision) for(T t : Mesh.this) { if (!good) break; @@ -472,6 +481,7 @@ public class Mesh implements Iterable { return length()*t.area(); */ return (float)Math.max(length(), midpoint().distance(nearest.p)); + //return length(); } public int compareTo(E e) { return e.comparator() > comparator() ? 1 : -1;