Commit a8269c6f authored by Iulian Grindeanu's avatar Iulian Grindeanu
Browse files

bsp test on 32 bit machine was too strict

we should consider for machine arithmetic at least the
precision we used when the partitioning was built
instead of failing when the point is "above" the plane when something is > 0,
we should check if it is greater than EPSILON
parent d6359d5c
......@@ -815,6 +815,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
if (!faceList) // empty (zero-dimension) polyhedron
return false;
const double EPSILON = 1e-6;
// Test that point is below the plane of each face
// NOTE: This will NOT work for polyhedra w/ concavities
for (Face* face = faceList; face; face = face->nextPtr) {
......@@ -828,7 +829,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
CartVect norm = (*pt3 - *pt2) * (*pt1 - *pt2);
double coeff = -(norm % *pt2);
if (norm % point > -coeff) // if above plane
if ( (norm % point + coeff) > EPSILON) // if above plane, with some -epsilon
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment