From 8b33309ba20ddbdf925a78f44e34599be8736117 Mon Sep 17 00:00:00 2001 From: MP Date: Wed, 28 Aug 2024 15:07:06 +0200 Subject: [PATCH] :bug: IsOnPlane comparison with tolerance. --- FemDesign.Core/Geometry/Point3d.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FemDesign.Core/Geometry/Point3d.cs b/FemDesign.Core/Geometry/Point3d.cs index a14abe78..2c81cf96 100644 --- a/FemDesign.Core/Geometry/Point3d.cs +++ b/FemDesign.Core/Geometry/Point3d.cs @@ -173,8 +173,10 @@ public static bool ArePointsOnPlane(List points) for(int j = 0; j < points.Count; j++) { - bool IsOnPlane = (a * points[j].X + b * points[j].Y + c * points[j].Z + d) == 0; - if (IsOnPlane == true) + double IsOnPlane = a * points[j].X + b * points[j].Y + c * points[j].Z + d; + + // check is IsOnPlane is within tolerance + if (Math.Abs(IsOnPlane) <= Tolerance.LengthComparison) continue; else return false;