public static final Random random = new Random();
private PointSet<Vert> pointset = new PointSet<Vert>();
-
+ public int size() { return pointset.size(); }
public Iterable<Vert> vertices() { return pointset; }
public Iterable<E> edges() {
else if (nearest_in_other_mesh == null) {
if (score_against != null) {
Vert ne = score_against.nearest(p);
- oldscore = ne.fundamentalQuadric().preAndPostMultiply(p) * 100 * 100;
+ oldscore = ne.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
} else {
oldscore = 0;
}
} else {
- oldscore = nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 100;
+ oldscore = nearest_in_other_mesh.fundamentalQuadric().preAndPostMultiply(p) * 100 * 10;
}
} else {
- oldscore = (quadric.preAndPostMultiply(p) * 100);
+ oldscore = (quadric.preAndPostMultiply(p) * 100) / quadric_count;
}
oldscore = oldscore;
}
*/
- float minangle = (float)(Math.PI * 0.9);
+ float minangle = (float)(Math.PI * 0.8);
if (ang > minangle)
oldscore += (ang - minangle);
}
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;
return (float)(length()*Math.sqrt(t.area()));
return length()*t.area();
*/
- return length() + midpoint().distance(nearest.p);
+ return (float)Math.max(length(), midpoint().distance(nearest.p));
+ //return length();
}
public int compareTo(E e) {
return e.comparator() > comparator() ? 1 : -1;