Skip to content
Snippets Groups Projects
Commit 74b71a48 authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Error of multiplication by zero at zero scalar product fixed

parent 406b65bb
No related branches found
No related tags found
No related merge requests found
......@@ -359,12 +359,12 @@ public class HausdorffDistance extends MeshVisitor {
if (relativeDist) { // compute sign for relative distance
Vector3d aux = new Vector3d(closestV);
aux.sub(point.getPosition());
sign = (int) Math.signum(aux.dot(point.getNormal()));
}
sign = aux.dot(point.getNormal()) < 0 ? -1 : 1;
}
distances.get(facet).add(sign * dist);
if (nearestPoints.containsKey(facet)) { // only strategies with the closest points are stored in the map
nearestPoints.get(facet).add(closestV);
nearestPoints.get(facet).add(closestV);
}
}
......@@ -373,7 +373,7 @@ public class HausdorffDistance extends MeshVisitor {
* @return the only one existing closest vertex or {@code null}
*/
protected Point3d getClosestVertex(DistanceWithNearestPoints vis) {
if (vis.getNearestPoints().size() != 1) {
if (vis.getNearestPoints().size() != 1) {
return null; // somethig is wrong because there should be only my inspected facet
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment