{
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);
}
}
}
--- /dev/null
+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
--- /dev/null
+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