-
- public void applyQuadricToNeighbor() {
- if (score_against == null) return;
-
- Vertex new_nearest = score_against.nearest(p);
- if (nearest_in_other_mesh != null && new_nearest == nearest_in_other_mesh) return;
-
- if (nearest_in_other_mesh != null) unApplyQuadricToNeighbor();
- if (nearest_in_other_mesh != null) throw new Error();
-
- nearest_in_other_mesh = new_nearest;
-
- // don't attract to vertices that face the other way
-
- if (((Vertex)nearest_in_other_mesh).e == null || ((Vertex)nearest_in_other_mesh).norm().dot(norm()) < 0) {
- nearest_in_other_mesh = null;
- } else {
-
- nearest_in_other_mesh.unComputeError();
- nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.plus(fundamentalQuadric());
- nearest_in_other_mesh.quadric_count++;
- nearest_in_other_mesh.computeError();
-
+ public float averageEdgeLength() {
+ int count = 0;
+ float ret = 0;
+ for(E e = this.e; e!=null; e=e.pair.next==this.e?null:e.pair.next) {
+ ret += e.length();
+ count++;