diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index c087235d11..ce0ca26126 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -14,7 +14,7 @@ // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - +// #include // #include @@ -61,10 +61,13 @@ #include #include #include +#include +#include // #include #include #include +#include // #include // @@ -127,14 +130,143 @@ class BOPAlgo_BuilderSolid_ShapeBox { Bnd_Box myBox; }; // -typedef NCollection_DataMap\ - \ - BOPAlgo_DataMapOfIntegerBSSB; +typedef NCollection_DataMap + 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_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_VectorOfFaceSolid; +// +typedef BOPCol_TBBContextFunctor + BOPAlgo_FaceSolidFunctor; +// +typedef BOPCol_TBBContextCnt + BOPAlgo_FaceSolidCnt; +// +//======================================================================= +typedef NCollection_DataMap + BOPAlgo_DataMapOfShapePnt; + +typedef BOPAlgo_DataMapOfShapePnt::Iterator + BOPAlgo_DataMapIteratorOfDataMapOfShapePnt; +// +//======================================================================= //function : //purpose : //======================================================================= @@ -252,7 +384,10 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid() 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(); @@ -442,7 +577,8 @@ void BOPAlgo_BuilderSolid::PerformAreas() BOPCol_ListIteratorOfListOfInteger aItLI; BOPCol_BoxBndTreeSelector aSelector; BOPCol_BoxBndTree aBBTree; - NCollection_UBTreeFiller aTreeFiller(aBBTree); + NCollection_UBTreeFiller + aTreeFiller(aBBTree); BOPAlgo_DataMapOfIntegerBSSB aDMISB(100); BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB; BOPCol_DataMapOfShapeListOfShape aMSH; @@ -628,101 +764,206 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes() 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 + 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); - } - } - aNbFI=aMF.Extent(); - // - // 2 Process solids - aSolidIt.Initialize(myAreas); - for ( ; aSolidIt.More(); aSolidIt.Next()) { - TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aSolidIt.Value())); - // - TopExp_Explorer anExpSol(aSolid, TopAbs_FACE);; - for (; anExpSol.More(); anExpSol.Next()) { - const TopoDS_Shape& aF = anExpSol.Current(); - TopoDS_Shape aFF=aF; + const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value()); // - aFF.Orientation(TopAbs_FORWARD); - aMFx.Add(aFF); - aFF.Orientation(TopAbs_REVERSED); - aMFx.Add(aFF); - } - aMEF.Clear(); - BOPTools::MapShapesAndAncestors(aSolid, - TopAbs_EDGE, TopAbs_FACE, - aMEF); - // - // 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); + 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); } } - aMFx.Clear(); + } + // + if (!aNbA) { + // 7b. "Rest" faces treatment + TopoDS_Solid aSolid; + aBB.MakeSolid(aSolid); + // + MakeInternalShells(aMFs, aLSI); + // + aItLS.Initialize(aLSI); + for (; aItLS.More(); aItLS.Next()) { + const TopoDS_Shape& aSI=aItLS.Value(); + aBB.Add (aSolid, aSI); + } + myAreas.Append(aSolid); + // + return; // => + }//if (!aNbA) { + // + // 2. Prepare TreeFiller + aNbVFP=aVFP.Extent(); + for(k=0; k // #include @@ -121,11 +121,12 @@ class BOPAlgo_ShapeBox { Bnd_Box myBox; }; // -typedef NCollection_DataMap\ - \ - BOPAlgo_DataMapOfIntegerShapeBox; +typedef NCollection_DataMap + BOPAlgo_DataMapOfIntegerShapeBox; // -typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator \ +typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox; // @@ -565,6 +566,7 @@ void BOPAlgo_Builder::BuildSplitSolids BOPAlgo_BuilderSolid& aBS=aVBS.Append1(); aBS.SetSolid(aSolid); aBS.SetShapes(aSFS); + aBS.SetRunParallel(myRunParallel); aBS.SetProgressIndicator(myProgressIndicator); }//for (i=0; i - +// #include #include #include @@ -501,7 +501,8 @@ void BOPAlgo_PaveFiller::MakeBlocks() continue; } // - bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTolR3D); + bValid2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, + aF1, aF2, aTolR3D); if (!bValid2D) { continue; } @@ -543,7 +544,8 @@ void BOPAlgo_PaveFiller::MakeBlocks() 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()); @@ -578,7 +580,8 @@ void BOPAlgo_PaveFiller::MakeBlocks() 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); } // @@ -643,8 +646,6 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF // BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); // - // <-DEB f - // // 0 if (aNbS==1) { const TopoDS_Shape& aS=theMSCPB.FindKey(1); @@ -695,7 +696,7 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF aPF.Perform(); iErr=aPF.ErrorStatus(); if (iErr) { - iRet=1; + //iRet=1; //PKVft return iRet; } aPDS=aPF.PDS(); @@ -833,7 +834,8 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF 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); @@ -844,7 +846,8 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF } } 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); } @@ -889,7 +892,8 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF //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; @@ -1107,10 +1111,15 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& 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; } // @@ -1131,7 +1140,6 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& } return bRet; } - //======================================================================= //function : PutBoundPaveOnCurve //purpose : @@ -1237,14 +1245,15 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& //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; @@ -1293,10 +1302,11 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& //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))) { @@ -1328,7 +1338,8 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer 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(); // @@ -1377,15 +1388,17 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV 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); @@ -1427,10 +1440,11 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV //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; @@ -1477,12 +1491,13 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV //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); @@ -1581,8 +1596,10 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV 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); @@ -1593,7 +1610,8 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance(const Standard_Integer nV 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)) { @@ -1666,12 +1684,13 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, //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; @@ -1769,7 +1788,6 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, } } } - //======================================================================= //function : UpdateExistingPaveBlocks //purpose : @@ -1878,10 +1896,12 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, 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); @@ -1919,7 +1939,6 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, } } } - //======================================================================= // function: PutClosingPaveOnCurve // purpose: @@ -1975,7 +1994,6 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, } } } - //======================================================================= //function : PreparePostTreatFF //purpose : @@ -2012,9 +2030,9 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, //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; @@ -2052,7 +2070,8 @@ Standard_Boolean //function : UpdatePaveBlocks //purpose : //======================================================================= -void BOPAlgo_PaveFiller::UpdatePaveBlocks(const BOPCol_DataMapOfIntegerInteger& aDMI) +void BOPAlgo_PaveFiller::UpdatePaveBlocks + (const BOPCol_DataMapOfIntegerInteger& aDMI) { if (aDMI.IsEmpty()) { return; diff --git a/tests/boolean/bfuse_complex/O6 b/tests/boolean/bfuse_complex/O6 index f50fb7db11..84cb17076c 100644 --- a/tests/boolean/bfuse_complex/O6 +++ b/tests/boolean/bfuse_complex/O6 @@ -3,4 +3,4 @@ restore [locate_data_file CTO908_topo106-n.brep] nervure bfuse result poche nervure -set square 108943 +set square 105275 diff --git a/tests/boolean/bfuse_complex/P1 b/tests/boolean/bfuse_complex/P1 index b9194a1ae7..cc85ebf969 100644 --- a/tests/boolean/bfuse_complex/P1 +++ b/tests/boolean/bfuse_complex/P1 @@ -1,3 +1,4 @@ +puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is" # cts17861 restore [locate_data_file CTO900_cts17861a.rle] a diff --git a/tests/boolean/boptuc_complex/D5 b/tests/boolean/boptuc_complex/D5 index b83833325a..d9ec8760f5 100644 --- a/tests/boolean/boptuc_complex/D5 +++ b/tests/boolean/boptuc_complex/D5 @@ -1,3 +1,5 @@ +puts "TODO ?OCC24925 ALL: Error : The area of the resulting shape is" + restore [locate_data_file a102] a restore [locate_data_file b136] b diff --git a/tests/bugs/modalg_2/bug497_5 b/tests/bugs/modalg_2/bug497_5 index a99929b51a..c17b4269da 100755 --- a/tests/bugs/modalg_2/bug497_5 +++ b/tests/bugs/modalg_2/bug497_5 @@ -1,4 +1,4 @@ -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 "=========" diff --git a/tests/bugs/modalg_4/bug62 b/tests/bugs/modalg_4/bug62 index 954192f1b4..69f71b56d5 100755 --- a/tests/bugs/modalg_4/bug62 +++ b/tests/bugs/modalg_4/bug62 @@ -9,7 +9,7 @@ if {[string compare $os "MacOS"] == 0} { #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 "================" diff --git a/tests/bugs/modalg_5/bug24157_10 b/tests/bugs/modalg_5/bug24157_10 new file mode 100644 index 0000000000..e7cef59158 --- /dev/null +++ b/tests/bugs/modalg_5/bug24157_10 @@ -0,0 +1,91 @@ +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 diff --git a/tests/bugs/modalg_5/bug24558 b/tests/bugs/modalg_5/bug24558 index dc896c9c53..abd263363d 100644 --- a/tests/bugs/modalg_5/bug24558 +++ b/tests/bugs/modalg_5/bug24558 @@ -25,10 +25,10 @@ set nb_v_good 109 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