1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032136: Modeling Algorithms - Boolean fuse fails and corrupts the argument-shape

Avoid increasing tolerance of the vertex before the check on valid range is passed.
This commit is contained in:
emv
2021-03-04 21:25:48 +03:00
committed by bugmaster
parent 19ed08fda6
commit 58210e5983
3 changed files with 49 additions and 14 deletions

View File

@@ -3035,9 +3035,21 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC)
return;
}
if (aDistVP > aTolV)
// Check if there will be valid range on the curve
Standard_Real aFirst, aLast;
Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance());
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
aT[0], aP[0], aNewTolV,
aT[1], aP[1], aNewTolV,
aFirst, aLast))
{
Standard_Integer nVn = UpdateVertex(nV, aDistVP + BOPTools_AlgoTools::DTolerance());
// No valid range
return;
}
if (aNewTolV > aTolV)
{
Standard_Integer nVn = UpdateVertex(nV, aNewTolV);
if (nVn != nV)
{
aPave.SetIndex(nVn);
@@ -3046,17 +3058,6 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC)
aTolV = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV)));
}
// Check if there will be valid range on the curve
Standard_Real aFirst, aLast;
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
aT[0], aP[0], aTolV,
aT[1], aP[1], aTolV,
aFirst, aLast))
{
// No valid range
return;
}
// Add closing pave to the curve
BOPDS_Pave aNewPave;
aNewPave.SetIndex(nV);