]> OCCT Git - occt-copy.git/commitdiff
0028558: Test bugs modalg_6 bug26150_17 is failed with FPE switched on
authorjgv <jgv@opencascade.com>
Wed, 15 Mar 2017 13:36:47 +0000 (16:36 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 16 Mar 2017 10:28:05 +0000 (13:28 +0300)
Avoid division by zero in the method BRepFill_CompatibleWires::SameNumberByACR.

src/BRepFill/BRepFill_CompatibleWires.cxx

index 26c73185fcb650000773a2c6dcaf4b67a7a39168..6465264105d4318ed92e94317cd88345e2de1204 100644 (file)
@@ -1402,7 +1402,9 @@ void BRepFill_CompatibleWires::SameNumberByACR(const  Standard_Boolean  report)
       // insertion of cuts in each wire
       for (i=1; i<=nbSects; i++) {
        const TopoDS_Wire& oldwire = TopoDS::Wire(myWork(i));
-        Standard_Real tol = Precision::Confusion() / WireLen(i);
+        Standard_Real tol = Precision::Confusion();
+        if (WireLen(i) > gp::Resolution())
+          tol /= WireLen(i);
        TopoDS_Wire newwire = BRepFill::InsertACR(oldwire, dec3, tol);
        BRepTools_WireExplorer anExp1,anExp2;
        anExp1.Init(oldwire);