From 4f20ebce80a6ef0a22894194c53a60d1c3dd5148 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 28 Mar 2024 16:56:19 +1100 Subject: [PATCH] Change precision check of "is point on line" to be 0.01mm Precision::Confusion() is 1e-7 which is too small apparently when doing this math. There are plenty of results which are things like 5e-7. --- src/ifcgeom/kernels/opencascade/IfcGeomTree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h index 8c573f75f9..20a474960c 100644 --- a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h +++ b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h @@ -389,7 +389,7 @@ namespace IfcGeom { // Check if the point is on the line defined by start and end // by checking if the cross product is (near) zero vector, indicating collinearity. gp_Vec crossProduct = startToPoint.Crossed(startToEnd); - if (crossProduct.Magnitude() > Precision::Confusion()) { + if (crossProduct.Magnitude() > 1e-5) { return false; // Not collinear, hence not on the line segment } return true; // The point is on the line segment @@ -404,7 +404,7 @@ namespace IfcGeom { // Check if the point is on the line defined by start and end // by checking if the cross product is (near) zero vector, indicating collinearity. gp_Vec crossProduct = startToPoint.Crossed(startToEnd); - if (crossProduct.Magnitude() > Precision::Confusion()) { + if (crossProduct.Magnitude() > 1e-5) { return false; // Not collinear, hence not on the line segment } return true; // The point is on the line segment