mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:13:41 +00:00
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.
This commit is contained in:
@@ -388,7 +388,7 @@ namespace IfcGeom {
|
|||||||
// Check if the point is on the line defined by start and end
|
// 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.
|
// by checking if the cross product is (near) zero vector, indicating collinearity.
|
||||||
gp_Vec crossProduct = startToPoint.Crossed(startToEnd);
|
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 false; // Not collinear, hence not on the line segment
|
||||||
}
|
}
|
||||||
return true; // The point is on the line segment
|
return true; // The point is on the line segment
|
||||||
@@ -403,7 +403,7 @@ namespace IfcGeom {
|
|||||||
// Check if the point is on the line defined by start and end
|
// 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.
|
// by checking if the cross product is (near) zero vector, indicating collinearity.
|
||||||
gp_Vec crossProduct = startToPoint.Crossed(startToEnd);
|
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 false; // Not collinear, hence not on the line segment
|
||||||
}
|
}
|
||||||
return true; // The point is on the line segment
|
return true; // The point is on the line segment
|
||||||
|
|||||||
Reference in New Issue
Block a user