Don't consider borderline points to be inside a shape for more robust protrusion results

This commit is contained in:
Dion Moult
2024-03-28 16:56:54 +11:00
parent 4f20ebce80
commit 36ca54f3a2
@@ -252,6 +252,10 @@ namespace IfcGeom {
*/
double at, au, av;
if (intersectRayTriangle(ray_origin, ray_vector, ta, tb, tc, at, au, av, false)) {
if (std::abs(at) < 1e-4) {
// The point is basically lying on a face so inside/outside is ambiguous.
return false;
}
// At is a signed intersection distance (positive is along +ray_vector)
if (at > -1e-5) {
total_intersections++;