]> OCCT Git - occt.git/commitdiff
0028243: Bad result of the canonical recognition
authorifv <ifv@opencascade.com>
Tue, 5 Jul 2022 14:30:35 +0000 (17:30 +0300)
committersmoskvin <smoskvin@opencascade.com>
Thu, 7 Jul 2022 16:23:55 +0000 (19:23 +0300)
LProp/LProp_CLProps.gxx - minor modification to avoid floating overflow because of multiplication of large values

src/LProp/LProp_CLProps.gxx

index 8afa74d53c0c88889e25b3b12f5173631a67934e..499bab6cdaa8e946ed2496a41fbc7986b57a7797 100644 (file)
@@ -232,14 +232,15 @@ Standard_Real LProp_CLProps::Curvature ()
   {
     Standard_Real N = myDerivArr[0].CrossSquareMagnitude(myDerivArr[1]);
     // if d[0] and d[1] are colinear the curvature is null.
-    Standard_Real t = N/(DD1*DD2);
+    //Standard_Real t = N/(DD1*DD2);
+    Standard_Real t = N / DD1 / DD2;
     if (t<=Tol)
     {
       myCurvature = 0.0;
     }
     else
     {
-      myCurvature = sqrt(N) / (DD1*sqrt(DD1));
+      myCurvature = sqrt(N) / DD1 / sqrt(DD1);
     }
   }