Skip to content

Commit

Permalink
Fixes #2797
Browse files Browse the repository at this point in the history
Commenting out IsSelfIntersecting check for normal calculation for now until a better solution is added in #2803
  • Loading branch information
IsakNaslundBh committed Apr 28, 2022
1 parent d9293dc commit 0f21760
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Geometry_Engine/Query/Normal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ public static Vector Normal(this Polyline curve, double tolerance = Tolerance.Di
Base.Compute.RecordError("A single normal vector is not unambiguously definable for open curves.");
return null;
}
else if (curve.IsSelfIntersecting(tolerance))
Base.Compute.RecordWarning("Input curve is self-intersecting. Resulting normal vector might be flipped.");
//Turning of check as shown to be an extreme performance burden. To be handled more long term in https://github.com/BHoM/BHoM_Engine/issues/2803
//else if (curve.IsSelfIntersecting(tolerance))
// Base.Compute.RecordWarning("Input curve is self-intersecting. Resulting normal vector might be flipped.");

Point avg = curve.ControlPoints.Average();
Vector normal = new Vector();
Expand Down Expand Up @@ -174,9 +175,10 @@ public static Vector Normal(this PolyCurve curve, double tolerance = Tolerance.D
Base.Compute.RecordError("A single normal vector is not unambiguously definable for open curves.");
return null;
}
else if (curve.IsSelfIntersecting(tolerance))
Base.Compute.RecordWarning("Input curve is self-intersecting. Resulting normal vector might be flipped.");

//Turning of check as shown to be an extreme performance burden. To be handled more long term in https://github.com/BHoM/BHoM_Engine/issues/2803
//else if (curve.IsSelfIntersecting(tolerance))
// Base.Compute.RecordWarning("Input curve is self-intersecting. Resulting normal vector might be flipped.");

if (crvs.Count() == 0)
return null;
else if (crvs.Count() == 1)
Expand Down

0 comments on commit 0f21760

Please sign in to comment.