The branch CR24157_12 deals with the parallelization of building the solids in case of lot internal faces.
Test case for issue CR24157
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
+//
#include <BOPAlgo_BuilderSolid.ixx>
//
#include <NCollection_List.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_ListOfInteger.hxx>
+#include <BOPCol_NCVector.hxx>
+#include <BOPCol_TBB.hxx>
//
#include <BOPTools.hxx>
#include <BOPTools_CoupleOfShape.hxx>
#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
//
#include <IntTools_Context.hxx>
//
Bnd_Box myBox;
};
//
-typedef NCollection_DataMap\
- <Standard_Integer, BOPAlgo_BuilderSolid_ShapeBox, TColStd_MapIntegerHasher> \
- BOPAlgo_DataMapOfIntegerBSSB;
+typedef NCollection_DataMap
+ <Standard_Integer,
+ BOPAlgo_BuilderSolid_ShapeBox,
+ TColStd_MapIntegerHasher> BOPAlgo_DataMapOfIntegerBSSB;
//
-typedef BOPAlgo_DataMapOfIntegerBSSB::Iterator \
+typedef BOPAlgo_DataMapOfIntegerBSSB::Iterator
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB;
//
//=======================================================================
+//function : BOPAlgo_FacePnt
+//purpose :
+//=======================================================================
+class BOPAlgo_FacePnt {
+ public:
+ BOPAlgo_FacePnt() {
+ }
+ //
+ virtual ~BOPAlgo_FacePnt() {
+ }
+ //
+ void SetFace(const TopoDS_Face& aFace) {
+ myFace=aFace;
+ }
+ //
+ const TopoDS_Face& Face()const {
+ return myFace;
+ }
+ //
+ void SetPnt(const gp_Pnt& aPnt) {
+ myPnt=aPnt;
+ }
+ //
+ const gp_Pnt& Pnt()const {
+ return myPnt;
+ }
+ //
+ protected:
+ gp_Pnt myPnt;
+ TopoDS_Face myFace;
+};
+//
+typedef BOPCol_NCVector
+ <BOPAlgo_FacePnt> BOPAlgo_VectorOfFacePnt;
+//
+//=======================================================================
+//function : BOPAlgo_FaceSolid
+//purpose :
+//=======================================================================
+class BOPAlgo_FaceSolid : public BOPAlgo_Algo {
+ public:
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_FaceSolid() :
+ myIsInternalFace(Standard_False) {
+ }
+ //
+ virtual ~BOPAlgo_FaceSolid() {
+ }
+ //
+ void SetFace(const TopoDS_Face& aFace) {
+ myFace=aFace;
+ }
+ //
+ const TopoDS_Face& Face()const {
+ return myFace;
+ }
+ //
+ void SetSolid(const TopoDS_Solid& aSolid) {
+ mySolid=aSolid;
+ }
+ //
+ const TopoDS_Solid& Solid()const {
+ return mySolid;
+ }
+ //
+ void SetPnt(const gp_Pnt& aPnt) {
+ myPnt=aPnt;
+ }
+ //
+ const gp_Pnt& Pnt()const {
+ return myPnt;
+ }
+ void SetContext(const Handle(IntTools_Context)& aContext) {
+ myContext=aContext;
+ }
+ //
+ const Handle(IntTools_Context)& Context()const {
+ return myContext;
+ }
+ //
+ Standard_Boolean IsInternalFace() const {
+ return myIsInternalFace;
+ }
+ //
+ virtual void Perform () {
+ TopAbs_State aState;
+ //
+ BOPAlgo_Algo::UserBreak();
+ //
+ aState=BOPTools_AlgoTools::ComputeState(myPnt, mySolid,
+ 1.e-14, myContext);
+ //
+ myIsInternalFace=(aState==TopAbs_IN);
+ }
+ //
+ protected:
+ Standard_Boolean myIsInternalFace;
+ gp_Pnt myPnt;
+ TopoDS_Face myFace;
+ TopoDS_Solid mySolid;
+ Handle(IntTools_Context) myContext;
+};
+//=======================================================================
+typedef BOPCol_NCVector
+ <BOPAlgo_FaceSolid> BOPAlgo_VectorOfFaceSolid;
+//
+typedef BOPCol_TBBContextFunctor
+ <BOPAlgo_FaceSolid,
+ BOPAlgo_VectorOfFaceSolid,
+ Handle(IntTools_Context),
+ IntTools_Context> BOPAlgo_FaceSolidFunctor;
+//
+typedef BOPCol_TBBContextCnt
+ <BOPAlgo_FaceSolidFunctor,
+ BOPAlgo_VectorOfFaceSolid,
+ Handle(IntTools_Context)> BOPAlgo_FaceSolidCnt;
+//
+//=======================================================================
+typedef NCollection_DataMap
+ <TopoDS_Shape,
+ gp_Pnt,
+ TopTools_ShapeMapHasher> BOPAlgo_DataMapOfShapePnt;
+
+typedef BOPAlgo_DataMapOfShapePnt::Iterator
+ BOPAlgo_DataMapIteratorOfDataMapOfShapePnt;
+//
+//=======================================================================
//function :
//purpose :
//=======================================================================
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
if (!myShapesToAvoid.Contains(aF)) {
- BOPTools::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ BOPTools::MapShapesAndAncestors(aF,
+ TopAbs_EDGE,
+ TopAbs_FACE,
+ aMEF);
}
}
aNbE=aMEF.Extent();
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPCol_BoxBndTreeSelector aSelector;
BOPCol_BoxBndTree aBBTree;
- NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+ NCollection_UBTreeFiller
+ <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
BOPAlgo_DataMapOfIntegerBSSB aDMISB(100);
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB;
BOPCol_DataMapOfShapeListOfShape aMSH;
return;
}
//
+ Standard_Boolean bIsInternalFace;
+ Standard_Integer k, aNbVFS, aNbSLF, aNbVFP, aNbF, aNbA;
BRep_Builder aBB;
TopoDS_Iterator aIt;
- BOPCol_ListIteratorOfListOfShape aShellIt, aSolidIt;
- BOPCol_MapIteratorOfMapOfShape aItMF;
- //
- BOPCol_MapOfShape aMF, aMFP, aMFx;
- BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
+ TopExp_Explorer aExp;
+ BOPCol_ListIteratorOfListOfShape aItLS;
+ BOPCol_MapOfShape aMFs;
BOPCol_ListOfShape aLSI;
+ BOPAlgo_VectorOfFaceSolid aVFS;
+ BOPAlgo_VectorOfFacePnt aVFP;
+ BOPCol_ListIteratorOfListOfInteger aItLI;
+ BOPCol_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTree aBBTree;
+ NCollection_UBTreeFiller
+ <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
- // 1. All internal faces
- aShellIt.Initialize(myLoopsInternal);
- for (; aShellIt.More(); aShellIt.Next()) {
- const TopoDS_Shape& aShell=aShellIt.Value();
+ aNbA=myAreas.Extent();
+ //
+ // 1. aVFP
+ aItLS.Initialize(myLoopsInternal);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aShell=aItLS.Value();
aIt.Initialize(aShell);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aF=aIt.Value();
- aMF.Add(aF);
+ const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
+ //
+ if (aMFs.Add(aF)) {
+ gp_Pnt aP;
+ gp_Pnt2d aP2D;
+ //
+ if (aNbA) {
+ BOPTools_AlgoTools3D::PointInFace(aF, aP, aP2D, myContext);
+ }
+ //
+ BOPAlgo_FacePnt& aFP=aVFP.Append1();
+ aFP.SetFace(aF);
+ aFP.SetPnt(aP);
+ }
}
}
- aNbFI=aMF.Extent();
//
- // 2 Process solids
- aSolidIt.Initialize(myAreas);
- for ( ; aSolidIt.More(); aSolidIt.Next()) {
- TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aSolidIt.Value()));
+ if (!aNbA) {
+ // 7b. "Rest" faces treatment
+ TopoDS_Solid aSolid;
+ aBB.MakeSolid(aSolid);
//
- TopExp_Explorer anExpSol(aSolid, TopAbs_FACE);;
- for (; anExpSol.More(); anExpSol.Next()) {
- const TopoDS_Shape& aF = anExpSol.Current();
- TopoDS_Shape aFF=aF;
- //
- aFF.Orientation(TopAbs_FORWARD);
- aMFx.Add(aFF);
- aFF.Orientation(TopAbs_REVERSED);
- aMFx.Add(aFF);
+ MakeInternalShells(aMFs, aLSI);
+ //
+ aItLS.Initialize(aLSI);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSI=aItLS.Value();
+ aBB.Add (aSolid, aSI);
}
- aMEF.Clear();
- BOPTools::MapShapesAndAncestors(aSolid,
- TopAbs_EDGE, TopAbs_FACE,
- aMEF);
+ myAreas.Append(aSolid);
//
- // 2.1 Separate faces to process aMFP
- aMFP.Clear();
- aItMF.Initialize(aMF);
- for (; aItMF.More(); aItMF.Next()) {
- const TopoDS_Face& aF=(*(TopoDS_Face*)(&aItMF.Key()));
- if (!aMFx.Contains(aF)) {
- if (BOPTools_AlgoTools::IsInternalFace(aF,
- aSolid,
- aMEF,
- 1.e-14,
- myContext)) {
- aMFP.Add(aF);
- }
+ return; // =>
+ }//if (!aNbA) {
+ //
+ // 2. Prepare TreeFiller
+ aNbVFP=aVFP.Extent();
+ for(k=0; k<aNbVFP; ++k) {
+ Bnd_Box aBox;
+ //
+ const BOPAlgo_FacePnt& aFP=aVFP(k);
+ const TopoDS_Face& aF=aFP.Face();
+ //
+ BRepBndLib::Add(aF, aBox);
+ aTreeFiller.Add(k, aBox);
+ }
+ //
+ aTreeFiller.Fill();
+ //
+ // 3. Face/Solid candidates: aVFS
+ aItLS.Initialize(myAreas);
+ for (; aItLS.More(); aItLS.Next()) {
+ Bnd_Box aBox;
+ //
+ TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aItLS.Value()));
+ BRepBndLib::Add(aSolid, aBox);
+ //
+ aMFs.Clear();
+ aExp.Init(aSolid, TopAbs_FACE);
+ for (; aExp.More(); aExp.Next()) {
+ const TopoDS_Shape& aFs=aExp.Current();
+ aMFs.Add(aFs);
+ }
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBox);
+ //
+ aNbF=aBBTree.Select(aSelector);
+ //
+ const BOPCol_ListOfInteger& aLI=aSelector.Indices();
+ aItLI.Initialize(aLI);
+ for (; aItLI.More(); aItLI.Next()) {
+ k=aItLI.Value();
+ const BOPAlgo_FacePnt& aFP=aVFP(k);
+ const TopoDS_Face& aF=aFP.Face();
+ if (aMFs.Contains(aF)) {
+ continue;
}
+ //
+ const gp_Pnt& aP=aFP.Pnt();
+ //
+ BOPAlgo_FaceSolid& aFS=aVFS.Append1();
+ aFS.SetPnt(aP);
+ aFS.SetFace(aF);
+ aFS.SetSolid(aSolid);
}
- aMFx.Clear();
+ }
+ //
+ aNbVFS=aVFS.Extent();
+ if (!aNbVFS) {
+ return;
+ }
+ // 4. Refine candidares
+ //=============================================================
+ BOPAlgo_FaceSolidCnt::Perform(myRunParallel, aVFS, myContext);
+ //=============================================================
+ //
+ // 5. Solid/Faces: aMSLF
+ BOPCol_IndexedDataMapOfShapeListOfShape aMSLF;
+ BOPCol_MapOfShape aMFProcessed;
+ //
+ for (k=0; k < aNbVFS; ++k) {
+ const BOPAlgo_FaceSolid& aFS=aVFS(k);
//
- // 2.2 Make Internal Shells
- aLSI.Clear();
- MakeInternalShells(aMFP, aLSI);
+ const TopoDS_Solid& aSolid=aFS.Solid();
+ const TopoDS_Face& aF=aFS.Face();
//
- // 2.3 Add them to aSolid
- aShellIt.Initialize(aLSI);
- for (; aShellIt.More(); aShellIt.Next()) {
- const TopoDS_Shape& aSI=aShellIt.Value();
- aBB.Add (aSolid, aSI);
+ bIsInternalFace=aFS.IsInternalFace();
+ if (!bIsInternalFace) {
+ continue;
}
//
- // 2.4 Remove faces aMFP from aMF
- aItMF.Initialize(aMFP);
- for (; aItMF.More(); aItMF.Next()) {
- const TopoDS_Shape& aF=aItMF.Key();
- aMF.Remove(aF);
+ if (aMSLF.Contains(aSolid)) {
+ BOPCol_ListOfShape& aLF=aMSLF.ChangeFromKey(aSolid);
+ aLF.Append(aF);
}
+ else {
+ BOPCol_ListOfShape aLF;
+ //
+ aLF.Append(aF);
+ aMSLF.Add(aSolid, aLF);
+ }
+ }// for (k=0; k < aNbVE; ++k) {
+ //
+ // 6. Update Solids by internal Faces
+ aNbSLF=aMSLF.Extent();
+ for (k=1; k <= aNbSLF; ++k) {
+ const TopoDS_Shape& aSolid=aMSLF.FindKey(k);
+ TopoDS_Shape *pSolid=(TopoDS_Shape*)&aSolid;
//
- aNbFI=aMF.Extent();
- if (!aNbFI) {
- break;
+ const BOPCol_ListOfShape& aLF=aMSLF(k);
+ //
+ aMFs.Clear();
+ aItLS.Initialize(aLF);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aF=aItLS.Value();
+ aMFs.Add(aF);
+ aMFProcessed.Add(aF);
}
- } //for ( ; aSolidIt.More(); aSolidIt.Next()) {
+ //
+ aLSI.Clear();
+ MakeInternalShells(aMFs, aLSI);
+ //
+ aItLS.Initialize(aLSI);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSI=aItLS.Value();
+ aBB.Add (*pSolid, aSI);
+ }
+ }
+ //
+ // 7. "Rest" faces treatment (if there are)
+ aMFs.Clear();
+ for (k=0; k < aNbVFS; ++k) {
+ const BOPAlgo_FaceSolid& aFS=aVFS(k);
+ //
+ const TopoDS_Face& aF=aFS.Face();
+ if (!aMFProcessed.Contains(aF)) {
+ aMFs.Add(aF);
+ }
+ }
+ //
+ aNbFI=aMFs.Extent();
if (aNbFI) {
TopoDS_Solid aSolid;
aBB.MakeSolid(aSolid);
//
- MakeInternalShells(aMF, aLSI);
- aShellIt.Initialize(aLSI);
- for (; aShellIt.More(); aShellIt.Next()) {
- const TopoDS_Shape& aSI=aShellIt.Value();
+ aLSI.Clear();
+ MakeInternalShells(aMFs, aLSI);
+ //
+ aItLS.Initialize(aLSI);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSI=aItLS.Value();
aBB.Add (aSolid, aSI);
}
myAreas.Append(aSolid);
}
}
-
//=======================================================================
//function : MakeInternalShells
//purpose :
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
+//
#include <BOPAlgo_Builder.hxx>
//
#include <NCollection_IncAllocator.hxx>
Bnd_Box myBox;
};
//
-typedef NCollection_DataMap\
- <Standard_Integer, BOPAlgo_ShapeBox, TColStd_MapIntegerHasher> \
- BOPAlgo_DataMapOfIntegerShapeBox;
+typedef NCollection_DataMap
+ <Standard_Integer,
+ BOPAlgo_ShapeBox,
+ TColStd_MapIntegerHasher> BOPAlgo_DataMapOfIntegerShapeBox;
//
-typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator \
+typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator
BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox;
//
BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
aBS.SetSolid(aSolid);
aBS.SetShapes(aSFS);
+ aBS.SetRunParallel(myRunParallel);
aBS.SetProgressIndicator(myProgressIndicator);
}//for (i=0; i<aNbS; ++i) {
//
// commercial license or contractual agreement.
#include <BOPAlgo_PaveFiller.ixx>
-
+//
#include <Precision.hxx>
#include <NCollection_IncAllocator.hxx>
#include <Bnd_Box.hxx>
continue;
}
//
- bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTolR3D);
+ bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC,
+ aF1, aF2, aTolR3D);
if (!bValid2D) {
continue;
}
const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
//
- BOPTools_AlgoTools::MakeEdge (aIC, aV1, aT1, aV2, aT2, aTolR3D, aES);
+ BOPTools_AlgoTools::MakeEdge (aIC, aV1, aT1,
+ aV2, aT2, aTolR3D, aES);
BOPTools_AlgoTools::MakePCurve(aES, aF1, aF2, aIC,
mySectionAttribute.PCurveOnS1(),
mySectionAttribute.PCurveOnS2());
aTol = aItMV.Value();
//
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nV1);
- const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*)&aV.TShape());
+ const Handle(BRep_TVertex)& TV =
+ *((Handle(BRep_TVertex)*)&aV.TShape());
TV->Tolerance(aTol);
}
//
//
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
//
- // <-DEB f
- //
// 0
if (aNbS==1) {
const TopoDS_Shape& aS=theMSCPB.FindKey(1);
aPF.Perform();
iErr=aPF.ErrorStatus();
if (iErr) {
- iRet=1;
+ //iRet=1; //PKVft
return iRet;
}
aPDS=aPF.PDS();
nV=aPave[j].Index();
aV=aPDS->Shape(nV);
//
- if (!aMVI.IsBound(aV)) {// index of new vertex in theDS -> iV
+ if (!aMVI.IsBound(aV)) {
+ // index of new vertex in theDS -> iV
aSI.SetShapeType(TopAbs_VERTEX);
aSI.SetShape(aV);
iV=myDS->Append(aSI);
}
}
const BOPDS_Pave& aP1 = !j ? aPB1->Pave1() : aPB1->Pave2();
- if (aP1.Parameter() == aPave[j].Parameter() && aP1.Index() != iV) {
+ if (aP1.Parameter() == aPave[j].Parameter() &&
+ aP1.Index() != iV) {
aDMI.Bind(aP1.Index(), iV);
myDS->AddShapeSD(aP1.Index(), iV);
}
//function : UpdateFaceInfo
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME)
+void BOPAlgo_PaveFiller::UpdateFaceInfo
+ (BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME)
{
Standard_Integer i, j, nV1, nF1, nF2,
aNbFF, aNbC, aNbP, aNbS, aNbPBIn;
const TopoDS_Edge& aSp=(*(TopoDS_Edge *)(&aSISp.Shape()));
const Bnd_Box& aBoxSp=aSISp.Box();
//
- iFlag1 = (nV11 == nV21 || nV11 == nV22) ? 2 : (!aBoxSp.IsOut(aBoxP1) ? 1 : 0);
- iFlag2 = (nV12 == nV21 || nV12 == nV22) ? 2 : (!aBoxSp.IsOut(aBoxP2) ? 1 : 0);
+ iFlag1 = (nV11 == nV21 || nV11 == nV22) ? 2 :
+ (!aBoxSp.IsOut(aBoxP1) ? 1 : 0);
+ iFlag2 = (nV12 == nV21 || nV12 == nV22) ? 2 :
+ (!aBoxSp.IsOut(aBoxP2) ? 1 : 0);
if (iFlag1 && iFlag2) {
- if (aBoxSp.IsOut(aBoxPm) || myContext->ComputePE(aPm, theTolR3D, aSp, aTx)) {
+ if (aBoxSp.IsOut(aBoxPm) || myContext->ComputePE(aPm,
+ theTolR3D,
+ aSp,
+ aTx)) {
continue;
}
//
}
return bRet;
}
-
//=======================================================================
//function : PutBoundPaveOnCurve
//purpose :
//function : PutPavesOnCurve
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::PutPavesOnCurve(const BOPCol_MapOfInteger& aMVOnIn,
- const Standard_Real aTolR3D,
- BOPDS_Curve& aNC,
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- const BOPCol_MapOfInteger& aMI,
- const BOPCol_MapOfInteger& aMVEF,
- BOPCol_DataMapOfIntegerReal& aMVTol)
+ void BOPAlgo_PaveFiller::PutPavesOnCurve
+ (const BOPCol_MapOfInteger& aMVOnIn,
+ const Standard_Real aTolR3D,
+ BOPDS_Curve& aNC,
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ const BOPCol_MapOfInteger& aMI,
+ const BOPCol_MapOfInteger& aMVEF,
+ BOPCol_DataMapOfIntegerReal& aMVTol)
{
Standard_Boolean bInBothFaces;
Standard_Integer nV;
//function : ExtendedTolerance
//purpose :
//=======================================================================
-Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV,
- const BOPCol_MapOfInteger& aMI,
- Standard_Real& aTolVExt,
- const Standard_Integer aType)
+Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance
+ (const Standard_Integer nV,
+ const BOPCol_MapOfInteger& aMI,
+ Standard_Real& aTolVExt,
+ const Standard_Integer aType)
{
Standard_Boolean bFound = Standard_False;
if (!(myDS->IsNewShape(nV))) {
BOPDS_Interf *aInt = !k ? (BOPDS_Interf*) (&aEEs(i)) :
(BOPDS_Interf*) (&aEFs(i));
if (aInt->IndexNew() == nV) {
- if (aMI.Contains(aInt->Index1()) && aMI.Contains(aInt->Index2())) {
+ if (aMI.Contains(aInt->Index1()) &&
+ aMI.Contains(aInt->Index2())) {
const IntTools_CommonPrt& aComPrt = !k ? aEEs(i).CommonPart() :
aEFs(i).CommonPart();
//
const IntTools_CommonPrt& aCP = aEF.CommonPart();
Standard_Real aPar = aCP.VertexParameter1();
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&myDS->Shape(nE)));
- const TopoDS_Face& aFOpposite = (*(TopoDS_Face*)(&myDS->Shape(nFOpposite)));
+ const TopoDS_Face& aFOpposite =
+ (*(TopoDS_Face*)(&myDS->Shape(nFOpposite)));
//
const Handle(Geom_Curve)& aCurve = BRep_Tool::Curve(aE, f, l);
//
nF = (nFOpposite == nF1) ? nF2 : nF1;
const TopoDS_Face& aF = (*(TopoDS_Face*)(&myDS->Shape(nF)));
- Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(aE, aF, f, l);
+ Handle(Geom2d_Curve) aPCurve =
+ BRep_Tool::CurveOnSurface(aE, aF, f, l);
//
- GeomAPI_ProjectPointOnSurf& aProj = myContext->ProjPS(aFOpposite);
+ GeomAPI_ProjectPointOnSurf& aProj=myContext->ProjPS(aFOpposite);
//
gp_Pnt aPoint;
aCurve->D0(aPar, aPoint);
//function : ProcessUnUsedVertices
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::PutEFPavesOnCurve(BOPDS_Curve& aNC,
- const BOPCol_MapOfInteger& aMI,
- const BOPCol_MapOfInteger& aMVEF,
- BOPCol_DataMapOfIntegerReal& aMVTol)
+ void BOPAlgo_PaveFiller::PutEFPavesOnCurve
+ (BOPDS_Curve& aNC,
+ const BOPCol_MapOfInteger& aMI,
+ const BOPCol_MapOfInteger& aMVEF,
+ BOPCol_DataMapOfIntegerReal& aMVTol)
{
if (!aMVEF.Extent()) {
return;
//function : ProcessUnUsedVertices
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::PutStickPavesOnCurve(const TopoDS_Face& aF1,
- const TopoDS_Face& aF2,
- const BOPCol_MapOfInteger& aMI,
- BOPDS_Curve& aNC,
- const BOPCol_MapOfInteger& aMVStick,
- BOPCol_DataMapOfIntegerReal& aMVTol)
+ void BOPAlgo_PaveFiller::PutStickPavesOnCurve
+ (const TopoDS_Face& aF1,
+ const TopoDS_Face& aF2,
+ const BOPCol_MapOfInteger& aMI,
+ BOPDS_Curve& aNC,
+ const BOPCol_MapOfInteger& aMVStick,
+ BOPCol_DataMapOfIntegerReal& aMVTol)
{
BOPCol_MapOfInteger aMV;
aMV.Assign(aMVStick);
BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF();
BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF();
//
- Standard_Integer aNbLines[5] = {aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
- aVFs.Extent(), aEFs.Extent()};
+ Standard_Integer aNbLines[5] = {
+ aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
+ aVFs.Extent(), aEFs.Extent()
+ };
//collect indices of all shapes from nF1 and nF2.
aMI.Clear();
GetFullShapeMap(nF1, aMI);
for (i = 0; i < aNbLines[aTypeInt]; ++i) {
BOPDS_Interf* aInt = (aTypeInt==0) ? (BOPDS_Interf*)(&aVVs(i)) :
((aTypeInt==1) ? (BOPDS_Interf*)(&aVEs(i)) :
- ((aTypeInt==2) ? (BOPDS_Interf*)(&aEEs(i)) : (BOPDS_Interf*)(&aVFs(i))));
+ ((aTypeInt==2) ? (BOPDS_Interf*)(&aEEs(i)) :
+ (BOPDS_Interf*)(&aVFs(i))));
if (aInt->HasIndexNew()) {
aInt->Indices(nS1, nS2);
if(aMI.Contains(nS1) && aMI.Contains(nS2)) {
//function : PutPaveOnCurve
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::PutPaveOnCurve(const Standard_Integer nV,
- const Standard_Real aTolR3D,
- BOPDS_Curve& aNC,
- const BOPCol_MapOfInteger& aMI,
- BOPCol_DataMapOfIntegerReal& aMVTol,
- const Standard_Integer iCheckExtend)
+ void BOPAlgo_PaveFiller::PutPaveOnCurve
+ (const Standard_Integer nV,
+ const Standard_Real aTolR3D,
+ BOPDS_Curve& aNC,
+ const BOPCol_MapOfInteger& aMI,
+ BOPCol_DataMapOfIntegerReal& aMVTol,
+ const Standard_Integer iCheckExtend)
{
Standard_Boolean bIsVertexOnLine;
Standard_Real aT, aTol, aTolNew;
}
}
}
-
//=======================================================================
//function : UpdateExistingPaveBlocks
//purpose :
Standard_Integer nF = (aMPBOn1.Contains(aPBf) ||
aMPBIn1.Contains(aPBf)) ? nF2 : nF1;
const TopoDS_Face& aF = *(TopoDS_Face*)&myDS->Shape(nF);
- IntTools_Range aShrR(aPB->Pave1().Parameter(), aPB->Pave2().Parameter());
+ IntTools_Range aShrR(aPB->Pave1().Parameter(),
+ aPB->Pave2().Parameter());
const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge());
//
- Standard_Boolean bCom = BOPTools_AlgoTools::IsBlockInOnFace(aShrR, aF, aE, myContext);
+ Standard_Boolean bCom =
+ BOPTools_AlgoTools::IsBlockInOnFace(aShrR, aF, aE, myContext);
if (bCom) {
if (bCB) {
aCB = myDS->CommonBlock(aPB);
}
}
}
-
//=======================================================================
// function: PutClosingPaveOnCurve
// purpose:
}
}
}
-
//=======================================================================
//function : PreparePostTreatFF
//purpose :
//function : CheckPlanes
//purpose :
//=======================================================================
-Standard_Boolean
- BOPAlgo_PaveFiller::CheckPlanes(const Standard_Integer nF1,
- const Standard_Integer nF2)const
+Standard_Boolean BOPAlgo_PaveFiller::CheckPlanes
+ (const Standard_Integer nF1,
+ const Standard_Integer nF2)const
{
Standard_Boolean bToIntersect;
Standard_Integer i, nV2, iCnt;
//function : UpdatePaveBlocks
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::UpdatePaveBlocks(const BOPCol_DataMapOfIntegerInteger& aDMI)
+void BOPAlgo_PaveFiller::UpdatePaveBlocks
+ (const BOPCol_DataMapOfIntegerInteger& aDMI)
{
if (aDMI.IsEmpty()) {
return;
bfuse result poche nervure
-set square 108943
+set square 105275
+puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is"
# cts17861
restore [locate_data_file CTO900_cts17861a.rle] a
+puts "TODO ?OCC24925 ALL: Error : The area of the resulting shape is"
+
restore [locate_data_file a102] a
restore [locate_data_file b136] b
-puts "TODO OCC24861 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO ?OCC24861 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC24861 ALL: Error : The square of result shape is"
puts "========="
#puts "TODO #23828 MacOS: TEST INCOMPLETE"
} else {
#puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
- #puts "TODO OCC12345 ALL: Error : The square of result shape is"
+ puts "TODO ?OCC12345 ALL: Error : The square of result shape is"
}
puts "================"
--- /dev/null
+puts "============"
+puts "OCC24157"
+puts "============"
+puts ""
+############################################
+# Parallelization of assembly part of BO
+############################################
+
+box b0 10 10 10
+box b 12 12 12
+explode b f
+
+#--------------------------
+# 1
+copy b_1 f
+ttranslate f 0 -1 -1
+
+set q1 {}
+for {set i 1} {$i < 5} {incr i} {
+ tcopy f fx_$i
+ ttranslate fx_$i [expr ($i*2)] 0. 0.
+ lappend q1 fx_$i
+}
+eval compound $q1 b1
+donly b0 b1
+
+#--------------------------
+# 2
+copy b_3 f
+ttranslate f -1 0 -1
+
+set q2 {}
+for {set i 1} {$i < 5} {incr i} {
+ tcopy f fy_$i
+ ttranslate fy_$i 0. [expr ($i*2)] 0.
+ lappend q2 fy_$i
+}
+eval compound $q2 b2
+donly b0 b1 b2
+
+#--------------------------
+# 3
+copy b_5 f
+ttranslate f -1 -1 0
+
+set q3 {}
+for {set i 1} {$i < 5} {incr i} {
+ tcopy f fz_$i
+ ttranslate fz_$i 0. 0. [expr ($i*2)]
+ lappend q3 fz_$i
+}
+eval compound $q3 b3
+
+#--------------------------
+# 4
+box bx .2 .2 .2 1.6 1.6 1.6
+explode bx f
+
+set q4 {}
+for {set i 0} {$i < 5} {incr i} {
+ for {set j 0} {$j < 5} {incr j} {
+ for {set k 0} {$k < 5} {incr k} {
+ for {set m 1} {$m < 6} {incr m} {
+ tcopy bx_${m} sx1_${i}_${j}_${k}_${m}
+ ttranslate sx1_${i}_${j}_${k}_${m} [expr ($i)*2] [expr ($j)*2] [expr ($k)*2].
+ lappend q4 sx1_${i}_${j}_${k}_${m}
+ }
+ }
+ }
+}
+eval compound $q4 b4
+
+#--------------------------
+bclearobjects; bcleartools;
+baddobjects b0
+baddcompound b1
+baddcompound b2
+baddcompound b3
+baddcompound b4
+
+bfillds
+
+regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
+
+if { $tps_time > 5. } {
+ puts "Error: low performance"
+} else {
+ puts "OK: high performance"
+}
+
+set 2dviewer 1
set nb_e_good 189
set nb_w_good 95
set nb_f_good 88
-set nb_sh_good 11
+set nb_sh_good 13
set nb_sol_good 5
set nb_compsol_good 0
set nb_compound_good 1
-set nb_shape_good 498
+set nb_shape_good 500
set 2dviewer 1