X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=b4f282ab8f125d99dc76c0534609954c8f558fa8;hp=f63bd1d55a02c20179f21ccd726d54f01a239d3b;hb=a52409e4638827ad2cbc8895c4d9c63cc0a86394;hpb=87e7ecfbdce5f5ecb16cd911f21890ccbaf4679c diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index f63bd1d..b4f282a 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -20,13 +20,13 @@ public class Mesh implements Iterable { public boolean immutableVertices; public boolean ignorecollision = false; - public Mesh score_against = null; - public double score = 0; + public Mesh error_against = null; + public double error = 0; public Mesh(boolean immutableVertices) { this.immutableVertices = immutableVertices; } public void makeVerticesImmutable() { this.immutableVertices = true; } - public float score() { return (float)score; } + public float error() { return (float)error; } public int size() { return vertices.size(); } public Iterable vertices() { return vertices; } @@ -83,7 +83,7 @@ public class Mesh implements Iterable { Vertex bound_to = this; public Point getPoint() { return p; } - public float score() { return oldscore; } + public float error() { return olderror; } private Vertex(Point p) { this.p = p; @@ -91,11 +91,11 @@ public class Mesh implements Iterable { vertices.add(this); } - public float oldscore = 0; - public void setScore(float nscore) { - score -= oldscore; - oldscore = nscore; - score += oldscore; + public float olderror = 0; + public void setError(float nerror) { + error -= olderror; + olderror = nerror; + error += olderror; } public Matrix _recomputeFundamentalQuadric() { @@ -109,26 +109,26 @@ public class Mesh implements Iterable { } public HasQuadric nearest() { - if (score_against==null) return null; - return score_against.vertices.nearest(p, this); + if (error_against==null) return null; + return error_against.vertices.nearest(p, this); } - public void unComputeError() { setScore(0); } + public void unComputeError() { setError(0); } public void computeError() { - float nscore = + float nerror = quadric_count != 0 ? (quadric.preAndPostMultiply(p) * 100) / quadric_count : nearest_in_other_mesh != null ? nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10 - : score_against != null + : error_against != null ? nearest().fundamentalQuadric().preAndPostMultiply(p) * 100 * 10 : 0; for(E e = this.e; e!=null; e=e.pair.next==this.e?null:e.pair.next) { double ang = Math.abs(e.crossAngle()); if (ang > Math.PI) throw new Error(); float minangle = (float)(Math.PI * 0.8); - if (ang > minangle) nscore += (ang - minangle); + if (ang > minangle) nerror += (ang - minangle); } - setScore(nscore); + setError(nerror); } private void removeTrianglesFromRTree() { @@ -326,7 +326,7 @@ public class Mesh implements Iterable { public boolean intersects(T t) { return t.intersects(p1.p, p2.p); } public float comparator() { - Vertex nearest = score_against.nearest(midpoint()); + Vertex nearest = error_against.nearest(midpoint()); return (float)Math.max(length(), midpoint().distance(nearest.p)); } public int compareTo(E e) {