From: jgv Date: Tue, 11 Aug 2015 10:45:11 +0000 (+0300) Subject: 0026540: Errors in BRepOffsetAPI_MakeOffset: infinite loop in method FixHoles for... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FMOTORS-660;p=occt-copy.git 0026540: Errors in BRepOffsetAPI_MakeOffset: infinite loop in method FixHoles for closed results. --- diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index 54e0845c9a..4f2d90986a 100755 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -1578,7 +1578,7 @@ void BRepFill_OffsetWire::FixHoles() Pf = BRep_Tool::Pnt(Vf); Pl = BRep_Tool::Pnt(Vl); Standard_Real DistF = RealLast(), DistL = RealLast(); - Standard_Integer IndexF = 1, IndexL = 1; + Standard_Integer IndexF = 0, IndexL = 0; Standard_Boolean IsFirstF = Standard_False, IsFirstL = Standard_False; for (Standard_Integer i = 2; i <= UnclosedWires.Length(); i++) { @@ -1621,6 +1621,10 @@ void BRepFill_OffsetWire::FixHoles() IsFirstL = Standard_False; } } + if (DistF > MaxTol) + IndexF = 0; + if (DistL > MaxTol) + IndexL = 0; TopoDS_Wire theWire; TopoDS_Edge theEdge; TopoDS_Vertex theVertex; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx index a47a7df325..55457b3958 100755 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx @@ -335,9 +335,11 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset, } catch(...) //Every exception was caught. { +#ifdef Offset2D_DEBUG cout<<"An exception was caught in BRepOffsetAPI_MakeOffset::Perform : "; Standard_ConstructionError::Caught()->Print(cout); cout<