1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026132: Invalid result of boolean operation

1. The procedures for check of coincidence between Edge-Edge and Edge-Face have been added. These methods are used instead of searching interferences between corresponding sub-shapes. In most cases (including case for this issue), new methods are more reliable and faster than intersections. However, its use should be avoided in case when the edge is not coincide with edge/face of another argument evidently (e.g. if edge vertices are not in another edge/face).

2. Interface of both IntTools_EdgeFace and IntTools_EdgeEdge has been changed (adding/deleted some field and methods).

Some test cases have been corrected in accordance with their new behavior.
Test case for issue CR26132.
This commit is contained in:
nbv
2016-01-19 14:05:25 +03:00
committed by abv
parent 26ca3bd549
commit 6dc83e21b2
12 changed files with 274 additions and 545 deletions

View File

@@ -281,8 +281,9 @@ void BOPAlgo_PaveFiller::PerformEE()
return;
}
//
Standard_Boolean bJustAdd;
Standard_Boolean bJustAdd, bExpressCompute;
Standard_Integer i, iX, nE1, nE2, aNbCPrts, k, aNbFdgeEdge;
Standard_Integer nV11, nV12, nV21, nV22;
Standard_Real aTS11, aTS12, aTS21, aTS22, aT11, aT12, aT21, aT22;
TopAbs_ShapeEnum aType;
BOPDS_ListIteratorOfListOfPaveBlock aIt1, aIt2;
@@ -330,6 +331,8 @@ void BOPAlgo_PaveFiller::PerformEE()
}
aPB1->ShrunkData(aTS11, aTS12, aBB1);
//
aPB1->Indices(nV11, nV12);
//
aIt2.Initialize(aLPB2);
for (; aIt2.More(); aIt2.Next()) {
Bnd_Box aBB2;
@@ -347,8 +350,15 @@ void BOPAlgo_PaveFiller::PerformEE()
aPB1->Range(aT11, aT12);
aPB2->Range(aT21, aT22);
//
aPB2->Indices(nV21, nV22);
//
bExpressCompute=((nV11==nV21 && nV12==nV22) ||
(nV12==nV21 && nV11==nV22));
//
BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge.Append1();
//
//
anEdgeEdge.UseQuickCoincidenceCheck(bExpressCompute);
//
anEdgeEdge.SetPaveBlock1(aPB1);
anEdgeEdge.SetPaveBlock2(aPB2);
//

View File

@@ -147,6 +147,8 @@ void BOPAlgo_PaveFiller::PerformEF()
}
//
Standard_Boolean bJustAdd, bV[2];
Standard_Boolean bV1, bV2, bExpressCompute;
Standard_Integer nV1, nV2;
Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2];
Standard_Integer aNbEdgeFace, k;
Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection;
@@ -186,6 +188,9 @@ void BOPAlgo_PaveFiller::PerformEF()
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
//
const BOPCol_MapOfInteger& aMVIn=aFI.VerticesIn();
const BOPCol_MapOfInteger& aMVOn=aFI.VerticesOn();
//
aTolE=BRep_Tool::Tolerance(aE);
aTolF=BRep_Tool::Tolerance(aF);
//
@@ -210,6 +215,11 @@ void BOPAlgo_PaveFiller::PerformEF()
continue;
}
//
aPBR->Indices(nV1, nV2);
bV1=aMVIn.Contains(nV1) || aMVOn.Contains(nV1);
bV2=aMVIn.Contains(nV2) || aMVOn.Contains(nV2);
bExpressCompute=bV1 && bV2;
//
BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace.Append1();
//
aEdgeFace.SetIndices(nE, nF);
@@ -221,6 +231,7 @@ void BOPAlgo_PaveFiller::PerformEF()
aEdgeFace.SetTolF (aTolF);
aEdgeFace.SetDiscretize (aDiscretize);
aEdgeFace.SetDeflection (aDeflection);
aEdgeFace.UseQuickCoincidenceCheck(bExpressCompute);
//
IntTools_Range aSR(aTS1, aTS2);
IntTools_Range anewSR=aSR;