mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user