prevDist = dist;
min = ri;
}
}
int frontOrBack = p1.plane.compare(min.polygon.centroid(), TOL);
<BUG>Vector3d planePoint = p1.plane.normal.normalized().times(p1.plane.getDist());
int towardsOrAwayFrom = p1.plane.compare(
planePoint.plus(min.polygon.plane.normal), TOL);
</BUG>
if (frontOrBack > 0 && towardsOrAwayFrom < 0) {

prevDist = dist;
min = ri;
}
}
int frontOrBack = p1.plane.compare(min.polygon.centroid(), TOL);
Vector3d planePoint = p1.plane.getAnchor();
int towardsOrAwayFrom = p1.plane.compare(
planePoint.plus(min.polygon.plane.getNormal()), TOL);
if (frontOrBack > 0 && towardsOrAwayFrom < 0) {
