mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0028675: Invalid result of Boolean Cut operation when running with fuzzy value
Avoid small edges with empty list of PaveBlocks (removed edges) in the result (BOPAlgo_Builder::FillImagesEdges()).
This commit is contained in:
parent
c2f5b8211b
commit
752f9d7201
@ -69,37 +69,41 @@
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Integer i, aNbPBP, nE, nSp, nSpR;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItPB;
|
||||
//
|
||||
const BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->PaveBlocksPool();
|
||||
aNbPBP=aPBP.Extent();
|
||||
for (i=0; i<aNbPBP; ++i) {
|
||||
const BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
|
||||
if (aLPB.Extent()) {
|
||||
BOPCol_ListOfShape aLS(myAllocator);
|
||||
Standard_Integer i, aNbS = myDS->NbSourceShapes();
|
||||
for (i = 0; i < aNbS; ++i) {
|
||||
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
|
||||
if (aSI.ShapeType() != TopAbs_EDGE) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// Check if the pave blocks for the edge have been initialized
|
||||
if (!aSI.HasReference()) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aE = aSI.Shape();
|
||||
const BOPDS_ListOfPaveBlock& aLPB = myDS->PaveBlocks(i);
|
||||
//
|
||||
// Fill the images of the edge from the list of its pave blocks.
|
||||
// The small edges, having no pave blocks, will have the empty list
|
||||
// of images and, thus, will be avoided in the result.
|
||||
BOPCol_ListOfShape *pLS = myImages.Bound(aE, BOPCol_ListOfShape());
|
||||
//
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItPB(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aItPB.Value();
|
||||
Handle(BOPDS_PaveBlock) aPBR = myDS->RealPaveBlock(aPB);
|
||||
//
|
||||
const Handle(BOPDS_PaveBlock)& aPB1=aLPB.First();
|
||||
nE=aPB1->OriginalEdge();
|
||||
const TopoDS_Shape& aE=myDS->Shape(nE);
|
||||
Standard_Integer nSpR = aPBR->Edge();
|
||||
const TopoDS_Shape& aSpR = myDS->Shape(nSpR);
|
||||
pLS->Append(aSpR);
|
||||
myOrigins.Bind(aSpR, aE);
|
||||
//
|
||||
aItPB.Initialize(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next()) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
|
||||
Handle(BOPDS_PaveBlock) aPBR=myDS->RealPaveBlock(aPB);
|
||||
//
|
||||
nSpR=aPBR->Edge();
|
||||
const TopoDS_Shape& aSpR=myDS->Shape(nSpR);
|
||||
aLS.Append(aSpR);
|
||||
myOrigins.Bind(aSpR, aE);
|
||||
//
|
||||
if (myDS->IsCommonBlockOnEdge(aPB)) {
|
||||
nSp=aPB->Edge();
|
||||
const TopoDS_Shape& aSp=myDS->Shape(nSp);
|
||||
myShapesSD.Bind(aSp, aSpR);
|
||||
}
|
||||
if (myDS->IsCommonBlockOnEdge(aPB)) {
|
||||
Standard_Integer nSp = aPB->Edge();
|
||||
const TopoDS_Shape& aSp = myDS->Shape(nSp);
|
||||
myShapesSD.Bind(aSp, aSpR);
|
||||
}
|
||||
myImages.Bind(aE, aLS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -359,12 +359,19 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
continue;
|
||||
}
|
||||
//
|
||||
BOPDS_ListOfPaveBlock& aLPB1 = myDS->ChangePaveBlocks(nE1);
|
||||
if (aLPB1.IsEmpty()) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
BOPDS_ListOfPaveBlock& aLPB2 = myDS->ChangePaveBlocks(nE2);
|
||||
if (aLPB2.IsEmpty()) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Edge& aE1=(*(TopoDS_Edge *)(&aSIE1.Shape()));
|
||||
const TopoDS_Edge& aE2=(*(TopoDS_Edge *)(&aSIE2.Shape()));
|
||||
//
|
||||
BOPDS_ListOfPaveBlock& aLPB1=myDS->ChangePaveBlocks(nE1);
|
||||
BOPDS_ListOfPaveBlock& aLPB2=myDS->ChangePaveBlocks(nE2);
|
||||
//
|
||||
aIt1.Initialize(aLPB1);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
Bnd_Box aBB1;
|
||||
|
@ -1,5 +1,3 @@
|
||||
puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
|
||||
|
||||
puts "========="
|
||||
puts " OCC497 "
|
||||
puts "(case 3)"
|
||||
@ -14,9 +12,11 @@ checkshape a_1
|
||||
|
||||
restore [locate_data_file OCC497f.brep] a_2
|
||||
checkshape a_2
|
||||
breducetolerance a_2
|
||||
|
||||
bcut result a_1 a_2
|
||||
|
||||
checkprops result -s 1773.6
|
||||
checkprops result -s 2392.19 -v 7520.02
|
||||
checknbshapes result -shell 1 -solid 1
|
||||
checkshape result
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@ -17,6 +17,6 @@ baddtools b2
|
||||
bfillds
|
||||
bbop result 0
|
||||
|
||||
checkprops result -s 40.7799
|
||||
checkprops result -s 42.1078
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
27
tests/bugs/modalg_6/bug28675_1
Normal file
27
tests/bugs/modalg_6/bug28675_1
Normal file
@ -0,0 +1,27 @@
|
||||
puts "========"
|
||||
puts "OCC28675"
|
||||
puts "========"
|
||||
puts ""
|
||||
####################################################################
|
||||
# Invalid result of Boolean Cut operation when running with fuzzy value
|
||||
####################################################################
|
||||
|
||||
restore [locate_data_file bug28675_shapes.brep] b
|
||||
explode b
|
||||
bfuzzyvalue 1.e-5
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects b_1
|
||||
baddtools b_2
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
checkshape result
|
||||
if {[regexp "Faulties" [bopargcheck result]]} {
|
||||
puts "Error: the result of Cut operation is invalid"
|
||||
}
|
||||
|
||||
checkprops result -s 63598.7 -v 246258
|
||||
checknbshapes result -edge 12 -face 6 -shell 1 -solid 1
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
26
tests/bugs/modalg_6/bug28675_2
Normal file
26
tests/bugs/modalg_6/bug28675_2
Normal file
@ -0,0 +1,26 @@
|
||||
puts "========"
|
||||
puts "OCC28675"
|
||||
puts "========"
|
||||
puts ""
|
||||
####################################################################
|
||||
# Invalid result of Boolean Cut operation when running with fuzzy value
|
||||
####################################################################
|
||||
|
||||
restore [locate_data_file bug28675_shapes.brep] b
|
||||
explode b
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects b_1
|
||||
baddtools b_2
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
checkshape result
|
||||
if {[regexp "Faulties" [bopargcheck result]]} {
|
||||
puts "Error: the result of Cut operation is invalid"
|
||||
}
|
||||
|
||||
checkprops result -s 63598.7 -v 246258
|
||||
checknbshapes result -edge 12 -face 6 -shell 1 -solid 1
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user