1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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);

View File

@ -0,0 +1,34 @@
puts "============================================================================================="
puts "0032136: Modeling Algorithms - Boolean fuse fails and corrupts the argument-shape"
puts "============================================================================================="
puts ""
restore [locate_data_file bug32136_obj.brep] s
restore [locate_data_file bug32136_tools.brep] t
bclearobjects
bcleartools
baddobjects s
eval baddtools [explode t]
bfillds
bbop result 1
checkshape result
checknbshapes result -face 731 -shell 1 -solid 1 -t
checkprops result -s 0.051066 -v 8.9084e-06
foreach sh {result s} {
if {![regexp "This shape seems to be OK" [bopcheck $sh]]} {
puts "Error: the $sh shape is self-interfered"
}
checkmaxtol $sh -ref 5.e-6
}
foreach sh [explode t] {
if {![regexp "This shape seems to be OK" [bopcheck $sh]]} {
puts "Error: the $sh shape is self-interfered"
}
checkmaxtol $sh -ref 5.e-6
}
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -18,7 +18,7 @@ if {[regexp "Faulties" [bopargcheck result]]} {
puts "Error: bopargcheck has found some faulties in res2"
}
checkmaxtol result -ref 0.031968491076118669
checkmaxtol result -ref 5.e-6
smallview
don result sw tw