]> OCCT Git - occt-copy.git/commitdiff
0024640: Broken logic of check of variable for zero in IntCurvesFace_Intersector...
authorabv <abv@opencascade.com>
Wed, 19 Feb 2014 04:54:49 +0000 (08:54 +0400)
committerabv <abv@opencascade.com>
Tue, 25 Mar 2014 12:39:51 +0000 (16:39 +0400)
The check is fixed to avoid FPE division by zero

src/IntCurvesFace/IntCurvesFace_Intersector.cxx

index 4a1c6809de2bbee58dd2023bc21424090543ba79..0f93db935f5cb5a98cc85515dee82a5e40d5e4ec 100644 (file)
@@ -95,7 +95,7 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
     Standard_Boolean bFlag;
     //
     {
-      Standard_Real dU, dV, dA, dB, aR, aTresh; 
+      Standard_Real dU, dV, dA, dB, aTresh; 
       bFlag=Standard_True;
       //
       aTresh=100.;
@@ -108,15 +108,9 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
        dB=dU;
       }
       //
-      aR=dA/dB;
-      if (dB<Precision::PConfusion()) {
+      if (dB < Precision::PConfusion() || dA > dB * aTresh) {
        bFlag=!bFlag;
       }
-      else {
-       if (aR>aTresh) {
-         bFlag=!bFlag;
-       }
-      }
     }
     //
     if (bFlag) {