Skip to content

Commit

Permalink
Scale tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
oberbichler committed Apr 20, 2021
1 parent 7faeb10 commit e3135e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Bowerbird/Curvature/PrincipalCurvature.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Rhino.Geometry;
using Rhino.Geometry;
using System.Diagnostics;

using static System.Math;
Expand Down Expand Up @@ -40,7 +40,9 @@ public bool Compute(Surface surface, double u, double v)
K22 = (G11 * H22 - G12 * H12) / det;
}

if (Abs(K12) < 1e-10 && Abs(K21) < 1e-10)
var eps = Max(Abs(K11), Abs(K22)) * 1e-10;

if (Abs(K12) < eps && Abs(K21) < eps)
{
K1 = K11;
K2 = K22;
Expand Down

0 comments on commit e3135e8

Please sign in to comment.