]> OCCT Git - occt-copy.git/commitdiff
0026540: Errors in BRepOffsetAPI_MakeOffset: infinite loop in method FixHoles for... MOTORS-660
authorjgv <jgv@opencascade.com>
Tue, 11 Aug 2015 10:45:11 +0000 (13:45 +0300)
committerjgv <jgv@opencascade.com>
Tue, 11 Aug 2015 10:45:11 +0000 (13:45 +0300)
src/BRepFill/BRepFill_OffsetWire.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
src/BRepTest/BRepTest_CurveCommands.cxx

index 54e0845c9aaad1f8930edb8d952c7407689ba296..4f2d90986a11ee001c6356dce24af764a9ff9dba 100755 (executable)
@@ -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;
index a47a7df3259cf2b3ccae0b35975328b4a8110a97..55457b39583f8d39f026a2b4554862f3c0466b09 100755 (executable)
@@ -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<<endl;
+#endif
     NotDone();
     myShape.Nullify();
   }
index 37b03778464887c788a3a1cacaa40aa9f6a67d7b..cc99a5955bca187b359b7bfcab9ef08fd5167710 100755 (executable)
@@ -1525,7 +1525,9 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
 
     if ( !Paral.IsDone())
     {
+#ifdef Offset2D_DEBUG
       di << " Error: Offset is not done." << "\n";
+#endif
       return 1;
     }
     else