+
+ // the following two lines are a hack; they "snap" the
+ // estimate to one grid point or the other if the distance is
+ // less than some EPSILON. This ensures that the resulting
+ // mesh is watertight and meets the requirements of Mesh.java
+ if (Math.abs(fValueDesired-fValue1) < EPSILON) return 0;
+ if (Math.abs(fValueDesired-fValue2) < EPSILON) return 1;
+