From: akaftasev Date: Tue, 16 May 2023 12:42:26 +0000 (+0100) Subject: 0033361: Modeling Algorithm - Fuse operation generates incomplete result X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c0089adde3bae63b0e470fc67cf572f7610cb873;p=occt.git 0033361: Modeling Algorithm - Fuse operation generates incomplete result Added additional check of Face-Face intersection to avoid missing section edges because of sequence of Face-Face interference processing --- diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index e2cde28990..2cd1c27436 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -613,13 +613,23 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) // Map of PaveBlocks with the faces to which it has to be added BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap; // - for (i=0; i aFFToRecheck; + // aNbFF may be increased while processing this loop, because it is necessary to recheck + // some of Face-Face intersections to avoid missing section edges + // aNbFF will be increased to the number of potentially problematic Face-Face intersections + const Standard_Integer aNbFFPrev = aNbFF; + for (i = 0; i < aNbFF; ++i, aPS.Next()) + { if (UserBreak(aPS)) { return; } + // after passing through all of Face-Face intersections it is necessary to return + // to potentially problematic Face-Face intersections and process them one more time + const Standard_Integer aCurInd = i < aNbFFPrev ? i : aFFToRecheck[i - aNbFFPrev]; // - BOPDS_InterfFF& aFF=aFFs(i); + BOPDS_InterfFF& aFF=aFFs(aCurInd); aFF.Indices(nF1, nF2); // BOPDS_VectorOfPoint& aVP=aFF.ChangePoints(); @@ -742,6 +752,9 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) } } + // Added additional check of Face-Face intersection to avoid missing section edges + // because of sequence of Face-Face interference processing + Standard_Boolean isToRecheck = aNbC > 0 && i < aNbFFPrev; // // 3. Make section edges for (j=0; jUpdate(aLPB, Standard_False); // + if (aLPB.Extent() != 0) + { + isToRecheck = false; + } + aItLPB.Initialize(aLPB); for (; aItLPB.More(); aItLPB.Next()) { Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue(); @@ -856,7 +874,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) if (aMPBAdd.Add(aPBOut)) { // Add edge for processing as the section edge - PreparePostTreatFF(i, j, aPBOut, aMSCPB, aMVI, aLPBC); + PreparePostTreatFF(aCurInd, j, aPBOut, aMSCPB, aMVI, aLPBC); } } continue; @@ -875,7 +893,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) // // Keep info for post treatment BOPDS_CoupleOfPaveBlocks aCPB; - aCPB.SetIndexInterf(i); + aCPB.SetIndexInterf(aCurInd); aCPB.SetIndex(j); aCPB.SetPaveBlock1(aPB); // @@ -887,12 +905,17 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) aMVTol.UnBind(nV2); // Add existing pave blocks for post treatment - ProcessExistingPaveBlocks (i, j, nF1, nF2, aES, aMPBOnIn, aPBTree, + ProcessExistingPaveBlocks (aCurInd, j, nF1, nF2, aES, aMPBOnIn, aPBTree, aMSCPB, aMVI, aLPBC, aPBFacesMap, aMPBAdd); } // aLPBC.RemoveFirst(); }//for (j=0; j