mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0032578: Modeling Algorithms - Splitting face by set of edges fails
Update information about ON/IN sub-shapes for all touched faces when intersection with shapes of lower types (edges and vertices) complete. Previously only the faces participating in the Face/Face intersection were updated.
This commit is contained in:
@@ -471,6 +471,7 @@ void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange)
|
||||
for (j=1; j<=aNbPBIn; ++j) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j);
|
||||
nSp=aPB->Edge();
|
||||
Standard_ASSERT(nSp >= 0, "Face information is not up to date", continue);
|
||||
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
|
||||
//
|
||||
aSp.Orientation(TopAbs_FORWARD);
|
||||
|
@@ -152,6 +152,7 @@ void BOPAlgo_PaveFiller::CheckSelfInterference()
|
||||
Standard_Integer iPB, aNbPB = aMPBF.Extent();
|
||||
for (iPB = 1; iPB <= aNbPB; ++iPB) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBF(iPB);
|
||||
Standard_ASSERT(aPB->HasEdge(), "Face information is not up to date", continue);
|
||||
const TopoDS_Shape& aE = myDS->Shape(aPB->Edge());
|
||||
// add connection
|
||||
TopTools_IndexedMapOfShape* pMSOr = aMCSI.ChangeSeek(aE);
|
||||
|
@@ -237,13 +237,42 @@ typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
{
|
||||
// Update face info for all Face/Face intersection pairs
|
||||
// and also for the rest of the faces with FaceInfo already initialized,
|
||||
// i.e. anyhow touched faces.
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
|
||||
Standard_Integer iSize = myIterator->ExpectedLength();
|
||||
Message_ProgressScope aPSOuter(theRange, NULL, 1);
|
||||
if (!iSize) {
|
||||
return;
|
||||
|
||||
// Collect faces from intersection pairs
|
||||
TColStd_MapOfInteger aMIFence;
|
||||
Standard_Integer nF1, nF2;
|
||||
for (; myIterator->More(); myIterator->Next())
|
||||
{
|
||||
myIterator->Value(nF1, nF2);
|
||||
aMIFence.Add (nF1);
|
||||
aMIFence.Add (nF2);
|
||||
}
|
||||
//
|
||||
// Collect the rest of the touched faces
|
||||
for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); ++i)
|
||||
{
|
||||
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo (i);
|
||||
if (aSI.ShapeType() == TopAbs_FACE && aSI.HasReference())
|
||||
{
|
||||
aMIFence.Add (i);
|
||||
}
|
||||
}
|
||||
// Update face info
|
||||
myDS->UpdateFaceInfoOn (aMIFence);
|
||||
myDS->UpdateFaceInfoIn (aMIFence);
|
||||
|
||||
if (!iSize)
|
||||
{
|
||||
// no intersection pairs found
|
||||
return;
|
||||
}
|
||||
|
||||
Message_ProgressScope aPSOuter(theRange, NULL, 1);
|
||||
|
||||
BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
|
||||
aFFs.SetIncrement(iSize);
|
||||
//
|
||||
@@ -255,23 +284,8 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
// Post-processing options
|
||||
Standard_Boolean bSplitCurve = Standard_False;
|
||||
//
|
||||
// Fence map to store faces with updated FaceInfo structure
|
||||
TColStd_MapOfInteger aMIFence;
|
||||
// Prepare the pairs of faces for intersection
|
||||
BOPAlgo_VectorOfFaceFace aVFaceFace;
|
||||
Standard_Integer nF1, nF2;
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nF1, nF2);
|
||||
|
||||
aMIFence.Add (nF1);
|
||||
aMIFence.Add (nF2);
|
||||
}
|
||||
// Update face info
|
||||
myDS->UpdateFaceInfoOn (aMIFence);
|
||||
myDS->UpdateFaceInfoIn (aMIFence);
|
||||
|
||||
// Initialize interferences
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
if (UserBreak(aPSOuter))
|
||||
|
@@ -634,6 +634,7 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange)
|
||||
for (j = 1; j <= aNbPBIn; ++j) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
|
||||
nE=aPB->Edge();
|
||||
Standard_ASSERT(nE >= 0, "Face information is not up to date", continue);
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
||||
//
|
||||
BOPAlgo_MPC& aMPC=aVMPC.Appended();
|
||||
|
Reference in New Issue
Block a user