diff --git a/src/BRepLib/BRepLib_MakeWire.hxx b/src/BRepLib/BRepLib_MakeWire.hxx index 0cf4f27b0a..a57f572608 100644 --- a/src/BRepLib/BRepLib_MakeWire.hxx +++ b/src/BRepLib/BRepLib_MakeWire.hxx @@ -165,7 +165,7 @@ private: const TopTools_IndexedMapOfShape& myMapOfShape; //vertices gp_Pnt myP; - Standard_Real mySTol; + Standard_Real myTolP; Standard_Integer myVInd; Bnd_Box myVBox; NCollection_List myResultInd; diff --git a/src/BRepLib/BRepLib_MakeWire_1.cxx b/src/BRepLib/BRepLib_MakeWire_1.cxx index b30ed8f183..ab81724737 100644 --- a/src/BRepLib/BRepLib_MakeWire_1.cxx +++ b/src/BRepLib/BRepLib_MakeWire_1.cxx @@ -155,8 +155,10 @@ Standard_Boolean BRepLib_MakeWire::BRepLib_BndBoxVertexSelector:: Standard_Real aTolV = BRep_Tool::Tolerance(aV); Standard_Real aL = myP.SquareDistance(aVPnt); + Standard_Real aSTol = aTolV + myTolP; + aSTol *= aSTol; - if (aL < Max(aTolV*aTolV, mySTol)) + if (aL <= aSTol) { myResultInd.Append(theObj); return Standard_True; @@ -176,7 +178,7 @@ void BRepLib_MakeWire::BRepLib_BndBoxVertexSelector:: myP = theP; myVBox.Add(myP); myVBox.Enlarge(theTol); - mySTol = theTol*theTol; + myTolP = theTol; myVInd = theVInd; } diff --git a/tests/bugs/modalg_7/bug31611 b/tests/bugs/modalg_7/bug31611 new file mode 100644 index 0000000000..ec599cc8c9 --- /dev/null +++ b/tests/bugs/modalg_7/bug31611 @@ -0,0 +1,13 @@ +puts "=============================================================================================" +puts "OCC31611: BRepOffsetAPI_NormalProjection - can't build wire in 720 but it was possible in 691" +puts "=============================================================================================" + +restore [locate_data_file bug31611.brep] d + +plane p 0 0 0 1 1 1 0 +mkface f p -200 200 -200 200 +nproject r d f +eval wire w -unsorted [explode r] + +checknbshapes w -vertex 20 -edge 20 -wire 1 +checkprops w -l 342.576