Avoid increasing tolerance of the vertex before the check on valid range is passed.
return;
}
- if (aDistVP > aTolV)
- {
- Standard_Integer nVn = UpdateVertex(nV, aDistVP + BOPTools_AlgoTools::DTolerance());
- if (nVn != nV)
- {
- aPave.SetIndex(nVn);
- nV = nVn;
- }
- aTolV = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV)));
- }
-
// 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], aTolV,
- aT[1], aP[1], aTolV,
+ aT[0], aP[0], aNewTolV,
+ aT[1], aP[1], aNewTolV,
aFirst, aLast))
{
// No valid range
return;
}
+ if (aNewTolV > aTolV)
+ {
+ Standard_Integer nVn = UpdateVertex(nV, aNewTolV);
+ if (nVn != nV)
+ {
+ aPave.SetIndex(nVn);
+ nV = nVn;
+ }
+ aTolV = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV)));
+ }
+
// Add closing pave to the curve
BOPDS_Pave aNewPave;
aNewPave.SetIndex(nV);
--- /dev/null
+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
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