mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0024157: Parallelization of assembly part of BO
The modifications deal with the parallelization of P-curves computations. Added test cases bugs/modalg_5/bug24157_1 ... bug24157_9
This commit is contained in:
parent
945c35291e
commit
f1baf495b6
@ -102,7 +102,10 @@ is
|
|||||||
|
|
||||||
Init(me:out)
|
Init(me:out)
|
||||||
is virtual protected;
|
is virtual protected;
|
||||||
|
|
||||||
|
Prepare(me:out)
|
||||||
|
is protected;
|
||||||
|
|
||||||
PerformVV(me:out)
|
PerformVV(me:out)
|
||||||
is virtual protected;
|
is virtual protected;
|
||||||
|
|
||||||
|
@ -168,6 +168,11 @@ void BOPAlgo_PaveFiller::Perform()
|
|||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
Prepare();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 00
|
// 00
|
||||||
PerformVV();
|
PerformVV();
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
|
@ -19,6 +19,11 @@
|
|||||||
|
|
||||||
#include <NCollection_IncAllocator.hxx>
|
#include <NCollection_IncAllocator.hxx>
|
||||||
|
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
@ -29,6 +34,7 @@
|
|||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
@ -36,9 +42,7 @@
|
|||||||
|
|
||||||
#include <BOPCol_NCVector.hxx>
|
#include <BOPCol_NCVector.hxx>
|
||||||
#include <BOPCol_TBB.hxx>
|
#include <BOPCol_TBB.hxx>
|
||||||
|
#include <BOPCol_MapOfShape.hxx>
|
||||||
#include <BOPTools_AlgoTools.hxx>
|
|
||||||
#include <BOPTools_AlgoTools2D.hxx>
|
|
||||||
|
|
||||||
#include <BOPDS_VectorOfListOfPaveBlock.hxx>
|
#include <BOPDS_VectorOfListOfPaveBlock.hxx>
|
||||||
#include <BOPDS_ListOfPaveBlock.hxx>
|
#include <BOPDS_ListOfPaveBlock.hxx>
|
||||||
@ -54,6 +58,13 @@
|
|||||||
#include <BOPDS_FaceInfo.hxx>
|
#include <BOPDS_FaceInfo.hxx>
|
||||||
#include <BOPDS_MapOfPaveBlock.hxx>
|
#include <BOPDS_MapOfPaveBlock.hxx>
|
||||||
#include <BOPDS_Curve.hxx>
|
#include <BOPDS_Curve.hxx>
|
||||||
|
#include <BOPDS_Iterator.hxx>
|
||||||
|
|
||||||
|
#include <BOPTools_AlgoTools.hxx>
|
||||||
|
#include <BOPTools_AlgoTools2D.hxx>
|
||||||
|
|
||||||
|
static
|
||||||
|
Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF);
|
||||||
|
|
||||||
|
|
||||||
static void UpdateVertices(const TopoDS_Edge& aE,
|
static void UpdateVertices(const TopoDS_Edge& aE,
|
||||||
@ -146,6 +157,109 @@ typedef BOPCol_TBBCnt
|
|||||||
BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeCnt;
|
BOPAlgo_VectorOfSplitEdge> BOPAlgo_SplitEdgeCnt;
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
//class : BOPAlgo_MPC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
class BOPAlgo_MPC {
|
||||||
|
public:
|
||||||
|
BOPAlgo_MPC()
|
||||||
|
: myFlag(Standard_False) {
|
||||||
|
};
|
||||||
|
//
|
||||||
|
~BOPAlgo_MPC(){
|
||||||
|
};
|
||||||
|
//
|
||||||
|
void SetEdge(const TopoDS_Edge& aE) {
|
||||||
|
myE=aE;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Edge& Edge() const {
|
||||||
|
return myE;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
void SetFace(const TopoDS_Face& aF) {
|
||||||
|
myF=aF;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Face& Face() const {
|
||||||
|
return myF;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
void SetFlag(const Standard_Boolean bFlag) {
|
||||||
|
myFlag=bFlag;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Standard_Boolean Flag() const {
|
||||||
|
return myFlag;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
void Perform() {
|
||||||
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(myE, myF);
|
||||||
|
if (myFlag) {
|
||||||
|
UpdateVertices(myE, myF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
protected:
|
||||||
|
Standard_Boolean myFlag;
|
||||||
|
TopoDS_Edge myE;
|
||||||
|
TopoDS_Face myF;
|
||||||
|
};
|
||||||
|
//
|
||||||
|
//=======================================================================
|
||||||
|
typedef BOPCol_NCVector
|
||||||
|
<BOPAlgo_MPC> BOPAlgo_VectorOfMPC;
|
||||||
|
//
|
||||||
|
typedef BOPCol_TBBFunctor
|
||||||
|
<BOPAlgo_MPC,
|
||||||
|
BOPAlgo_VectorOfMPC> BOPAlgo_MPCFunctor;
|
||||||
|
//
|
||||||
|
typedef BOPCol_TBBCnt
|
||||||
|
<BOPAlgo_MPCFunctor,
|
||||||
|
BOPAlgo_VectorOfMPC> BOPAlgo_MPCCnt;
|
||||||
|
//
|
||||||
|
//=======================================================================
|
||||||
|
//class : BOPAlgo_BPC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
class BOPAlgo_BPC {
|
||||||
|
public:
|
||||||
|
BOPAlgo_BPC(){
|
||||||
|
};
|
||||||
|
//
|
||||||
|
~BOPAlgo_BPC(){
|
||||||
|
};
|
||||||
|
//
|
||||||
|
void SetFace(const TopoDS_Face& aF) {
|
||||||
|
myF=aF;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
void SetEdge(const TopoDS_Edge& aE) {
|
||||||
|
myE=aE;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
void Perform() {
|
||||||
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (myE, myF);
|
||||||
|
};
|
||||||
|
//
|
||||||
|
protected:
|
||||||
|
TopoDS_Edge myE;
|
||||||
|
TopoDS_Face myF;
|
||||||
|
};
|
||||||
|
//=======================================================================
|
||||||
|
typedef BOPCol_NCVector
|
||||||
|
<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
|
||||||
|
//
|
||||||
|
typedef BOPCol_TBBFunctor
|
||||||
|
<BOPAlgo_BPC,
|
||||||
|
BOPAlgo_VectorOfBPC> BOPAlgo_BPCFunctor;
|
||||||
|
//
|
||||||
|
typedef BOPCol_TBBCnt
|
||||||
|
<BOPAlgo_BPCFunctor,
|
||||||
|
BOPAlgo_VectorOfBPC> BOPAlgo_BPCCnt;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//=======================================================================
|
||||||
// function: MakeSplitEdges
|
// function: MakeSplitEdges
|
||||||
// purpose:
|
// purpose:
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -297,10 +411,12 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPAlgo_PaveFiller::MakePCurves()
|
void BOPAlgo_PaveFiller::MakePCurves()
|
||||||
{
|
{
|
||||||
|
|
||||||
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI;
|
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI;
|
||||||
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
|
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
|
||||||
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
|
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
|
||||||
TopoDS_Face aF1F, aF2F;
|
TopoDS_Face aF1F, aF2F;
|
||||||
|
BOPAlgo_VectorOfMPC aVMPC;
|
||||||
//
|
//
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -322,8 +438,11 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
nE=aPB->Edge();
|
nE=aPB->Edge();
|
||||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF1F);
|
BOPAlgo_MPC& aMPC=aVMPC.Append1();
|
||||||
|
aMPC.SetEdge(aE);
|
||||||
|
aMPC.SetFace(aF1F);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
// On
|
// On
|
||||||
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
|
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
|
||||||
aItMPB.Initialize(aMPBOn);
|
aItMPB.Initialize(aMPBOn);
|
||||||
@ -333,51 +452,61 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
nE=aPB->Edge();
|
nE=aPB->Edge();
|
||||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF1F);
|
BOPAlgo_MPC& aMPC=aVMPC.Append1();
|
||||||
|
aMPC.SetEdge(aE);
|
||||||
|
aMPC.SetFace(aF1F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}// for (i=0; i<aNbFI; ++i) {
|
||||||
//
|
|
||||||
if (!mySectionAttribute.PCurveOnS1() &&
|
|
||||||
!mySectionAttribute.PCurveOnS2()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 2. Process section edges
|
// 2. Process section edges
|
||||||
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
|
Standard_Boolean bPCurveOnS[2];
|
||||||
aNbFF=aFFs.Extent();
|
Standard_Integer m;
|
||||||
for (i=0; i<aNbFF; ++i) {
|
TopoDS_Face aFf[2];
|
||||||
const BOPDS_InterfFF& aFF=aFFs(i);
|
//
|
||||||
aFF.Indices(nF1, nF2);
|
bPCurveOnS[0]=mySectionAttribute.PCurveOnS1();
|
||||||
//
|
bPCurveOnS[1]=mySectionAttribute.PCurveOnS2();
|
||||||
aF1F=(*(TopoDS_Face *)(&myDS->Shape(nF1)));
|
//
|
||||||
aF1F.Orientation(TopAbs_FORWARD);
|
if (bPCurveOnS[0] || bPCurveOnS[1]) {
|
||||||
aF2F=(*(TopoDS_Face *)(&myDS->Shape(nF2)));
|
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
|
||||||
aF2F.Orientation(TopAbs_FORWARD);
|
aNbFF=aFFs.Extent();
|
||||||
//
|
for (i=0; i<aNbFF; ++i) {
|
||||||
const BOPDS_VectorOfCurve& aVNC=aFF.Curves();
|
const BOPDS_InterfFF& aFF=aFFs(i);
|
||||||
aNbC=aVNC.Extent();
|
aFF.Indices(nF1, nF2);
|
||||||
for (k=0; k<aNbC; ++k) {
|
//
|
||||||
const BOPDS_Curve& aNC=aVNC(k);
|
aFf[0]=(*(TopoDS_Face *)(&myDS->Shape(nF1)));
|
||||||
const BOPDS_ListOfPaveBlock& aLPB=aNC.PaveBlocks();
|
aFf[0].Orientation(TopAbs_FORWARD);
|
||||||
aItLPB.Initialize(aLPB);
|
//
|
||||||
for(; aItLPB.More(); aItLPB.Next()) {
|
aFf[1]=(*(TopoDS_Face *)(&myDS->Shape(nF2)));
|
||||||
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
|
aFf[1].Orientation(TopAbs_FORWARD);
|
||||||
nE=aPB->Edge();
|
//
|
||||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
const BOPDS_VectorOfCurve& aVNC=aFF.Curves();
|
||||||
//
|
aNbC=aVNC.Extent();
|
||||||
if (mySectionAttribute.PCurveOnS1()) {
|
for (k=0; k<aNbC; ++k) {
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF1F);
|
const BOPDS_Curve& aNC=aVNC(k);
|
||||||
UpdateVertices(aE, aF1F);
|
const BOPDS_ListOfPaveBlock& aLPB=aNC.PaveBlocks();
|
||||||
}
|
aItLPB.Initialize(aLPB);
|
||||||
//
|
for(; aItLPB.More(); aItLPB.Next()) {
|
||||||
if (mySectionAttribute.PCurveOnS2()) {
|
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF2F);
|
nE=aPB->Edge();
|
||||||
UpdateVertices(aE, aF2F);
|
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
|
||||||
|
//
|
||||||
|
for (m=0; m<2; ++m) {
|
||||||
|
if (bPCurveOnS[m]) {
|
||||||
|
BOPAlgo_MPC& aMPC=aVMPC.Append1();
|
||||||
|
aMPC.SetEdge(aE);
|
||||||
|
aMPC.SetFace(aFf[m]);
|
||||||
|
aMPC.SetFlag(bPCurveOnS[m]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}// for (i=0; i<aNbFF; ++i) {
|
||||||
}
|
}//if (bPCurveOnS1 || bPCurveOnS2 ) {
|
||||||
|
//
|
||||||
|
//======================================================
|
||||||
|
BOPAlgo_MPCCnt::Perform(myRunParallel, aVMPC);
|
||||||
|
//======================================================
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: RefineFaceInfoOn
|
// function: RefineFaceInfoOn
|
||||||
@ -463,4 +592,79 @@ void UpdateVertices(const TopoDS_Edge& aE,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: Prepare
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void BOPAlgo_PaveFiller::Prepare()
|
||||||
|
{
|
||||||
|
TopAbs_ShapeEnum aType[] = {
|
||||||
|
TopAbs_VERTEX,
|
||||||
|
TopAbs_EDGE,
|
||||||
|
TopAbs_FACE
|
||||||
|
};
|
||||||
|
Standard_Boolean bJustAdd, bIsBasedOnPlane;
|
||||||
|
Standard_Integer i, aNb, n1, nF;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
BOPCol_MapOfShape aMF;
|
||||||
|
BOPCol_MapIteratorOfMapOfShape aItMF;
|
||||||
|
//
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
aNb=3;
|
||||||
|
for(i=0; i<aNb; ++i) {
|
||||||
|
myIterator->Initialize(aType[i], aType[2]);
|
||||||
|
for (; myIterator->More(); myIterator->Next()) {
|
||||||
|
myIterator->Value(n1, nF, bJustAdd);
|
||||||
|
const TopoDS_Face& aF=(*(TopoDS_Face *)(&myDS->Shape(nF)));
|
||||||
|
//
|
||||||
|
bIsBasedOnPlane=IsBasedOnPlane(aF);
|
||||||
|
if (bIsBasedOnPlane) {
|
||||||
|
aMF.Add(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (aMF.IsEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BOPAlgo_VectorOfBPC aVBPC;
|
||||||
|
//
|
||||||
|
aItMF.Initialize(aMF);
|
||||||
|
for (; aItMF.More(); aItMF.Next()) {
|
||||||
|
const TopoDS_Face& aF=*((TopoDS_Face *)&aItMF.Key());
|
||||||
|
aExp.Init(aF, aType[1]);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE=*((TopoDS_Edge *)&aExp.Current());
|
||||||
|
BOPAlgo_BPC& aBPC=aVBPC.Append1();
|
||||||
|
aBPC.SetEdge(aE);
|
||||||
|
aBPC.SetFace(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//======================================================
|
||||||
|
BOPAlgo_BPCCnt::Perform(myRunParallel, aVBPC);
|
||||||
|
//======================================================
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsBasedOnPlane
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF)
|
||||||
|
{
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) aGRTS;
|
||||||
|
Handle(Geom_Plane) aGP;
|
||||||
|
|
||||||
|
const Handle(Geom_Surface)& aS = BRep_Tool::Surface(aF, aLoc);
|
||||||
|
aGRTS = Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
|
||||||
|
if(!aGRTS.IsNull()) {
|
||||||
|
aGP = Handle(Geom_Plane)::DownCast(aGRTS->BasisSurface());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aGP = Handle(Geom_Plane)::DownCast(aS);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return (!aGP.IsNull());
|
||||||
|
}
|
||||||
|
@ -41,7 +41,7 @@ class BOPDS_Interf {
|
|||||||
* index of the second shape
|
* index of the second shape
|
||||||
*/
|
*/
|
||||||
void SetIndices(const Standard_Integer theIndex1,
|
void SetIndices(const Standard_Integer theIndex1,
|
||||||
const Standard_Integer theIndex2) {
|
const Standard_Integer theIndex2) {
|
||||||
myIndex1=theIndex1;
|
myIndex1=theIndex1;
|
||||||
myIndex2=theIndex2;
|
myIndex2=theIndex2;
|
||||||
}
|
}
|
||||||
@ -54,10 +54,10 @@ class BOPDS_Interf {
|
|||||||
* index of the second shape
|
* index of the second shape
|
||||||
*/
|
*/
|
||||||
void Indices(Standard_Integer& theIndex1,
|
void Indices(Standard_Integer& theIndex1,
|
||||||
Standard_Integer& theIndex2) const {
|
Standard_Integer& theIndex2) const {
|
||||||
theIndex1=myIndex1;
|
theIndex1=myIndex1;
|
||||||
theIndex2=myIndex2;
|
theIndex2=myIndex2;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
* Sets the index of the first interferred shape
|
* Sets the index of the first interferred shape
|
||||||
@ -163,7 +163,7 @@ class BOPDS_Interf {
|
|||||||
* @return true if the interference has index of new shape
|
* @return true if the interference has index of new shape
|
||||||
*/
|
*/
|
||||||
Standard_Boolean HasIndexNew() const {
|
Standard_Boolean HasIndexNew() const {
|
||||||
return (myIndexNew>=0);
|
return (myIndexNew+1);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
protected:
|
protected:
|
||||||
@ -184,7 +184,7 @@ class BOPDS_Interf {
|
|||||||
virtual ~BOPDS_Interf() {
|
virtual ~BOPDS_Interf() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Standard_Integer myIndex1;
|
Standard_Integer myIndex1;
|
||||||
Standard_Integer myIndex2;
|
Standard_Integer myIndex2;
|
||||||
Standard_Integer myIndexNew;
|
Standard_Integer myIndexNew;
|
||||||
@ -336,7 +336,7 @@ class BOPDS_InterfVF : public BOPDS_Interf {
|
|||||||
* value of U parameter
|
* value of U parameter
|
||||||
*/
|
*/
|
||||||
void SetUV(const Standard_Real theU,
|
void SetUV(const Standard_Real theU,
|
||||||
const Standard_Real theV) {
|
const Standard_Real theV) {
|
||||||
myU=theU;
|
myU=theU;
|
||||||
myV=theV;
|
myV=theV;
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,23 @@
|
|||||||
#include <Geom2d_Ellipse.hxx>
|
#include <Geom2d_Ellipse.hxx>
|
||||||
#include <Geom2d_Parabola.hxx>
|
#include <Geom2d_Parabola.hxx>
|
||||||
#include <Geom2d_Hyperbola.hxx>
|
#include <Geom2d_Hyperbola.hxx>
|
||||||
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
|
|
||||||
|
#include <Geom2dAdaptor.hxx>
|
||||||
|
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <GeomAdaptor_HCurve.hxx>
|
|
||||||
#include <Geom_TrimmedCurve.hxx>
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
|
||||||
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
|
#include <GeomAdaptor_HCurve.hxx>
|
||||||
|
#include <GeomAdaptor_HSurface.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
|
||||||
|
#include <GeomProjLib.hxx>
|
||||||
|
|
||||||
#include <TopLoc_Location.hxx>
|
#include <TopLoc_Location.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
@ -41,37 +53,56 @@
|
|||||||
#include <ProjLib_ProjectedCurve.hxx>
|
#include <ProjLib_ProjectedCurve.hxx>
|
||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepTools.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||||
|
#include <BRep_TEdge.hxx>
|
||||||
|
#include <BRep_CurveRepresentation.hxx>
|
||||||
|
#include <BRep_GCurve.hxx>
|
||||||
|
|
||||||
#include <BRepAdaptor_HSurface.hxx>
|
#include <BRepAdaptor_HSurface.hxx>
|
||||||
|
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
|
||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
#include <Geom2d_Curve.hxx>
|
|
||||||
#include <Geom_Plane.hxx>
|
|
||||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
|
||||||
#include <BRep_Builder.hxx>
|
|
||||||
#include <Geom_Surface.hxx>
|
|
||||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
|
||||||
#include <BOPTools.hxx>
|
|
||||||
#include <BRepClass_FaceClassifier.hxx>
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
|
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
|
||||||
|
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
|
#include <BOPTools.hxx>
|
||||||
|
|
||||||
static
|
static
|
||||||
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E);
|
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& );
|
||||||
|
|
||||||
|
static
|
||||||
|
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface(const TopoDS_Edge& ,
|
||||||
|
const TopoDS_Face& ,
|
||||||
|
Standard_Real& ,
|
||||||
|
Standard_Real& ,
|
||||||
|
Standard_Boolean& );
|
||||||
|
static
|
||||||
|
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface(const TopoDS_Edge& ,
|
||||||
|
const Handle(Geom_Surface)& ,
|
||||||
|
const TopLoc_Location& ,
|
||||||
|
Standard_Real& ,
|
||||||
|
Standard_Real& ,
|
||||||
|
Standard_Boolean& );
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BuildPCurveForEdgeOnFace
|
//function : BuildPCurveForEdgeOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF)
|
const TopoDS_Face& aF)
|
||||||
{
|
{
|
||||||
BRep_Builder aBB;
|
BRep_Builder aBB;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
Standard_Real aTolPC, aTolFact, aTolEdge, aFirst, aLast;
|
Standard_Real aTolPC, aTolFact, aTolEdge, aFirst, aLast;
|
||||||
|
|
||||||
Standard_Boolean aHasOld;
|
Standard_Boolean aHasOld;
|
||||||
aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, aC2D, aFirst, aLast, aTolEdge);
|
aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, aC2D,
|
||||||
|
aFirst, aLast,
|
||||||
|
aTolEdge);
|
||||||
if (aHasOld) {
|
if (aHasOld) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -91,9 +122,10 @@ static
|
|||||||
//function : EdgeTangent
|
//function : EdgeTangent
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::EdgeTangent(const TopoDS_Edge& anEdge,
|
Standard_Boolean BOPTools_AlgoTools2D::EdgeTangent
|
||||||
const Standard_Real aT,
|
(const TopoDS_Edge& anEdge,
|
||||||
gp_Vec& aTau)
|
const Standard_Real aT,
|
||||||
|
gp_Vec& aTau)
|
||||||
{
|
{
|
||||||
Standard_Boolean isdgE;
|
Standard_Boolean isdgE;
|
||||||
Standard_Real first, last;
|
Standard_Real first, last;
|
||||||
@ -127,17 +159,18 @@ static
|
|||||||
//function : PointOnOnSurface
|
//function : PointOnOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF,
|
const TopoDS_Face& aF,
|
||||||
const Standard_Real aParameter,
|
const Standard_Real aParameter,
|
||||||
Standard_Real& U,
|
Standard_Real& U,
|
||||||
Standard_Real& V)
|
Standard_Real& V)
|
||||||
{
|
{
|
||||||
gp_Pnt2d aP2D;
|
gp_Pnt2d aP2D;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
Standard_Real aToler, aFirst, aLast;
|
Standard_Real aToler, aFirst, aLast;
|
||||||
|
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D, aFirst, aLast, aToler);
|
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D,
|
||||||
|
aFirst, aLast, aToler);
|
||||||
aC2D->D0(aParameter, aP2D);
|
aC2D->D0(aParameter, aP2D);
|
||||||
U=aP2D.X();
|
U=aP2D.X();
|
||||||
V=aP2D.Y();
|
V=aP2D.Y();
|
||||||
@ -148,32 +181,35 @@ static
|
|||||||
//function : CurveOnSurface
|
//function : CurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF,
|
const TopoDS_Face& aF,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
Standard_Real& aToler)
|
Standard_Real& aToler)
|
||||||
{
|
{
|
||||||
Standard_Real aFirst, aLast;
|
Standard_Real aFirst, aLast;
|
||||||
|
//
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D, aFirst, aLast, aToler);
|
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D,
|
||||||
|
aFirst, aLast, aToler);
|
||||||
|
//
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CurveOnSurface
|
//function : CurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF,
|
const TopoDS_Face& aF,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
Standard_Real& aFirst,
|
Standard_Real& aFirst,
|
||||||
Standard_Real& aLast,
|
Standard_Real& aLast,
|
||||||
Standard_Real& aToler)
|
Standard_Real& aToler)
|
||||||
{
|
{
|
||||||
Standard_Boolean aHasOld;
|
Standard_Boolean aHasOld;
|
||||||
Handle(Geom2d_Curve) C2D;
|
Handle(Geom2d_Curve) C2D;
|
||||||
|
|
||||||
aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, C2D, aFirst, aLast, aToler);
|
aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, C2D,
|
||||||
|
aFirst, aLast,
|
||||||
|
aToler);
|
||||||
if (aHasOld) {
|
if (aHasOld) {
|
||||||
aC2D=C2D;
|
aC2D=C2D;
|
||||||
return;
|
return;
|
||||||
@ -183,17 +219,17 @@ static
|
|||||||
aC2D=C2D;
|
aC2D=C2D;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : HasCurveOnSurface
|
//function : HasCurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface (const TopoDS_Edge& aE,
|
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
||||||
const TopoDS_Face& aF,
|
(const TopoDS_Edge& aE,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
const TopoDS_Face& aF,
|
||||||
Standard_Real& aFirst,
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
Standard_Real& aLast,
|
Standard_Real& aFirst,
|
||||||
Standard_Real& aToler)
|
Standard_Real& aLast,
|
||||||
|
Standard_Real& aToler)
|
||||||
{
|
{
|
||||||
Standard_Boolean aHasOld;
|
Standard_Boolean aHasOld;
|
||||||
|
|
||||||
@ -204,7 +240,7 @@ static
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
aC2D =BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||||
aHasOld=!aC2D.IsNull();
|
aHasOld=!aC2D.IsNull();
|
||||||
return aHasOld;
|
return aHasOld;
|
||||||
}
|
}
|
||||||
@ -212,32 +248,35 @@ static
|
|||||||
//function : HasCurveOnSurface
|
//function : HasCurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface (const TopoDS_Edge& aE,
|
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
||||||
const TopoDS_Face& aF)
|
(const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Boolean aHasOld;
|
Standard_Boolean bHasOld;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
Standard_Real aFirst, aLast;
|
Standard_Real aFirst, aLast;
|
||||||
|
//
|
||||||
BRep_Tool::Range(aE, aFirst, aLast);
|
BRep_Tool::Range(aE, aFirst, aLast);
|
||||||
|
//
|
||||||
if((aLast - aFirst) < Precision::PConfusion()) {
|
if((aLast - aFirst) < Precision::PConfusion()) {
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
aC2D =BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||||
aHasOld=!aC2D.IsNull();
|
bHasOld=!aC2D.IsNull();
|
||||||
return aHasOld;
|
//
|
||||||
|
return bHasOld;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AdjustPCurveOnFace
|
//function : AdjustPCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::AdjustPCurveOnFace (const TopoDS_Face& aF,
|
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
||||||
const Handle(Geom_Curve)& aC3D,
|
(const TopoDS_Face& aF,
|
||||||
const Handle(Geom2d_Curve)& aC2D,
|
const Handle(Geom_Curve)& aC3D,
|
||||||
Handle(Geom2d_Curve)& aC2DA)
|
const Handle(Geom2d_Curve)& aC2D,
|
||||||
|
Handle(Geom2d_Curve)& aC2DA)
|
||||||
{
|
{
|
||||||
Standard_Real first, last;
|
Standard_Real first, last;
|
||||||
|
|
||||||
@ -250,11 +289,12 @@ static
|
|||||||
//function : AdjustPCurveOnFace
|
//function : AdjustPCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::AdjustPCurveOnFace (const TopoDS_Face& aF,
|
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
||||||
const Standard_Real aFirst,
|
(const TopoDS_Face& aF,
|
||||||
const Standard_Real aLast,
|
const Standard_Real aFirst,
|
||||||
const Handle(Geom2d_Curve)& aC2D,
|
const Standard_Real aLast,
|
||||||
Handle(Geom2d_Curve)& aC2DA)
|
const Handle(Geom2d_Curve)& aC2D,
|
||||||
|
Handle(Geom2d_Curve)& aC2DA)
|
||||||
{
|
{
|
||||||
Standard_Boolean mincond, maxcond, decalu, decalv;
|
Standard_Boolean mincond, maxcond, decalu, decalv;
|
||||||
Standard_Integer k, iCnt;
|
Standard_Integer k, iCnt;
|
||||||
@ -402,8 +442,9 @@ static
|
|||||||
//function : IntermediatePoint
|
//function : IntermediatePoint
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Real BOPTools_AlgoTools2D::IntermediatePoint (const Standard_Real aFirst,
|
Standard_Real BOPTools_AlgoTools2D::IntermediatePoint
|
||||||
const Standard_Real aLast)
|
(const Standard_Real aFirst,
|
||||||
|
const Standard_Real aLast)
|
||||||
{
|
{
|
||||||
//define parameter division number as 10*e^(-PI) = 0.43213918
|
//define parameter division number as 10*e^(-PI) = 0.43213918
|
||||||
const Standard_Real PAR_T = 0.43213918;
|
const Standard_Real PAR_T = 0.43213918;
|
||||||
@ -415,7 +456,8 @@ static
|
|||||||
//function : IntermediatePoint
|
//function : IntermediatePoint
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Real BOPTools_AlgoTools2D::IntermediatePoint (const TopoDS_Edge& aE)
|
Standard_Real BOPTools_AlgoTools2D::IntermediatePoint
|
||||||
|
(const TopoDS_Edge& aE)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Real aT, aT1, aT2;
|
Standard_Real aT, aT1, aT2;
|
||||||
@ -432,88 +474,47 @@ static
|
|||||||
//function : BuildPCurveForEdgeOnPlane
|
//function : BuildPCurveForEdgeOnPlane
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane
|
||||||
const TopoDS_Face& aF)
|
(const TopoDS_Edge& aE,
|
||||||
{
|
const TopoDS_Face& aF)
|
||||||
Standard_Real aTolE;
|
{
|
||||||
TopLoc_Location aLoc;
|
Standard_Boolean bToUpdate;
|
||||||
|
Standard_Real aTolE, aT1, aT2;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
Handle(Geom_Plane) aGP;
|
|
||||||
Handle(Geom_RectangularTrimmedSurface) aGRTS;
|
|
||||||
BRep_Builder aBB;
|
BRep_Builder aBB;
|
||||||
//
|
//
|
||||||
const Handle(Geom_Surface)& aS = BRep_Tool::Surface(aF, aLoc);
|
aC2D=BRep_Tool_CurveOnSurface(aE, aF, aT1, aT2, bToUpdate);
|
||||||
aGRTS=Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
|
if (bToUpdate) {
|
||||||
if(!aGRTS.IsNull()){
|
aTolE=BRep_Tool::Tolerance(aE);
|
||||||
aGP=Handle(Geom_Plane)::DownCast(aGRTS->BasisSurface());
|
aBB.UpdateEdge(aE, aC2D, aF, aTolE);
|
||||||
}
|
|
||||||
else {
|
|
||||||
aGP=Handle(Geom_Plane)::DownCast(aS);
|
|
||||||
}
|
}
|
||||||
//
|
|
||||||
if (aGP.IsNull()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF, aC2D, aTolE);
|
|
||||||
aBB.UpdateEdge(aE, aC2D, aF, aTolE);
|
|
||||||
//
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: BuildPCurveForEdgesOnPlane
|
// function: BuildPCurveForEdgesOnPlane
|
||||||
// purpose:
|
// purpose:
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::BuildPCurveForEdgesOnPlane
|
void BOPTools_AlgoTools2D::BuildPCurveForEdgesOnPlane
|
||||||
(const BOPCol_ListOfShape& aEdges,
|
(const BOPCol_ListOfShape& aLE,
|
||||||
const TopoDS_Face& aFace)
|
const TopoDS_Face& aF)
|
||||||
{
|
{
|
||||||
|
|
||||||
TopLoc_Location aLoc;
|
|
||||||
Handle(Geom2d_Curve) aC2D;
|
|
||||||
Handle(Geom_Plane) aGP;
|
|
||||||
Handle(Geom_RectangularTrimmedSurface) aGRTS;
|
|
||||||
//
|
|
||||||
const Handle(Geom_Surface)& aS = BRep_Tool::Surface(aFace, aLoc);
|
|
||||||
aGRTS=Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
|
|
||||||
if(!aGRTS.IsNull()){
|
|
||||||
aGP=Handle(Geom_Plane)::DownCast(aGRTS->BasisSurface());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
aGP=Handle(Geom_Plane)::DownCast(aS);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (aGP.IsNull()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
Standard_Boolean bHasOld;
|
|
||||||
Standard_Real aTolE, aT1, aT2;
|
|
||||||
BOPCol_ListIteratorOfListOfShape aIt;
|
BOPCol_ListIteratorOfListOfShape aIt;
|
||||||
BRep_Builder aBB;
|
|
||||||
//
|
//
|
||||||
aIt.Initialize(aEdges);
|
aIt.Initialize(aLE);
|
||||||
for(; aIt.More(); aIt.Next()) {
|
for(; aIt.More(); aIt.Next()) {
|
||||||
const TopoDS_Edge& aE=(*(TopoDS_Edge *)&aIt.Value());
|
const TopoDS_Edge& aE=(*(TopoDS_Edge *)&aIt.Value());
|
||||||
bHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (aE, aF);
|
||||||
(aE, aFace, aC2D, aT1, aT2, aTolE);
|
|
||||||
if (!bHasOld) {
|
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFace, aC2D, aTolE);
|
|
||||||
aBB.UpdateEdge(aE, aC2D, aFace, aTolE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Make2D
|
//function : Make2D
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF,
|
const TopoDS_Face& aF,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
Standard_Real& aFirst,
|
Standard_Real& aFirst,
|
||||||
Standard_Real& aLast,
|
Standard_Real& aLast,
|
||||||
Standard_Real& aToler)
|
Standard_Real& aToler)
|
||||||
{
|
{
|
||||||
Standard_Boolean aLocIdentity;
|
Standard_Boolean aLocIdentity;
|
||||||
Standard_Real f3d, l3d;
|
Standard_Real f3d, l3d;
|
||||||
@ -558,10 +559,10 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
//function : MakePCurveOnFace
|
//function : MakePCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
||||||
const Handle(Geom_Curve)& aC3D,
|
const Handle(Geom_Curve)& aC3D,
|
||||||
Handle(Geom2d_Curve)& aC2D, //->
|
Handle(Geom2d_Curve)& aC2D, //->
|
||||||
Standard_Real& TolReached2d)
|
Standard_Real& TolReached2d)
|
||||||
{
|
{
|
||||||
Standard_Real aFirst, aLast;
|
Standard_Real aFirst, aLast;
|
||||||
|
|
||||||
@ -570,26 +571,29 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
//
|
//
|
||||||
TolReached2d=0.;
|
TolReached2d=0.;
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::MakePCurveOnFace (aF, aC3D, aFirst, aLast, aC2D, TolReached2d);
|
BOPTools_AlgoTools2D::MakePCurveOnFace (aF, aC3D, aFirst,
|
||||||
|
aLast, aC2D, TolReached2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MakePCurveOnFace
|
//function : MakePCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||||
const Handle(Geom_Curve)& aC3D,
|
(const TopoDS_Face& aF,
|
||||||
const Standard_Real aFirst,
|
const Handle(Geom_Curve)& aC3D,
|
||||||
const Standard_Real aLast,
|
const Standard_Real aFirst,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
const Standard_Real aLast,
|
||||||
Standard_Real& TolReached2d)
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
|
Standard_Real& TolReached2d)
|
||||||
{
|
{
|
||||||
Standard_Real aTolR;
|
Standard_Real aTolR;
|
||||||
Handle(Geom2d_Curve) aC2DA;
|
Handle(Geom2d_Curve) aC2DA;
|
||||||
|
|
||||||
BRepAdaptor_Surface aBAS(aF, Standard_False);
|
BRepAdaptor_Surface aBAS(aF, Standard_False);
|
||||||
Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(aBAS);
|
Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(aBAS);
|
||||||
Handle(GeomAdaptor_HCurve) aBAHC = new GeomAdaptor_HCurve(aC3D, aFirst, aLast);
|
Handle(GeomAdaptor_HCurve) aBAHC = new
|
||||||
|
GeomAdaptor_HCurve(aC3D, aFirst, aLast);
|
||||||
|
|
||||||
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
||||||
if (aBAS.GetType() == GeomAbs_SurfaceOfRevolution) {
|
if (aBAS.GetType() == GeomAbs_SurfaceOfRevolution) {
|
||||||
@ -617,7 +621,8 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
}
|
}
|
||||||
TolReached2d=aTolR;
|
TolReached2d=aTolR;
|
||||||
|
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aFirst, aLast, aC2D, aC2DA);
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aFirst, aLast,
|
||||||
|
aC2D, aC2DA);
|
||||||
aC2D=aC2DA;
|
aC2D=aC2DA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,8 +630,9 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
//function : MakePCurveOfType
|
//function : MakePCurveOfType
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::MakePCurveOfType(const ProjLib_ProjectedCurve& PC,
|
void BOPTools_AlgoTools2D::MakePCurveOfType
|
||||||
Handle(Geom2d_Curve)& C2D)
|
(const ProjLib_ProjectedCurve& PC,
|
||||||
|
Handle(Geom2d_Curve)& C2D)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (PC.GetType()) {
|
switch (PC.GetType()) {
|
||||||
@ -652,11 +658,11 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
case GeomAbs_BezierCurve :
|
case GeomAbs_BezierCurve :
|
||||||
case GeomAbs_OtherCurve :
|
case GeomAbs_OtherCurve :
|
||||||
default :
|
default :
|
||||||
Standard_NotImplemented::Raise("BOPTools_AlgoTools2D::MakePCurveOfType");
|
Standard_NotImplemented::Raise
|
||||||
|
("BOPTools_AlgoTools2D::MakePCurveOfType");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckEdgeLength
|
//function : CheckEdgeLength
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -692,174 +698,124 @@ Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E)
|
|||||||
ln+=d;
|
ln+=d;
|
||||||
p1=p2;
|
p1=p2;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
return (ln > Precision::Confusion());
|
return (ln > Precision::Confusion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FaceNormal
|
//function : BRep_Tool_CurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::FaceNormal (const TopoDS_Face& aF,
|
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface(const TopoDS_Edge& E,
|
||||||
const Standard_Real U,
|
const TopoDS_Face& F,
|
||||||
const Standard_Real V,
|
Standard_Real& First,
|
||||||
gp_Vec& aN)
|
Standard_Real& Last,
|
||||||
|
Standard_Boolean& bToUpdate)
|
||||||
{
|
{
|
||||||
gp_Pnt aPnt ;
|
TopLoc_Location l;
|
||||||
gp_Vec aD1U, aD1V;
|
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,l);
|
||||||
Handle(Geom_Surface) aSurface;
|
TopoDS_Edge aLocalEdge = E;
|
||||||
|
if (F.Orientation() == TopAbs_REVERSED) {
|
||||||
aSurface=BRep_Tool::Surface(aF);
|
aLocalEdge.Reverse();
|
||||||
aSurface->D1 (U, V, aPnt, aD1U, aD1V);
|
|
||||||
aN=aD1U.Crossed(aD1V);
|
|
||||||
aN.Normalize();
|
|
||||||
if (aF.Orientation() == TopAbs_REVERSED){
|
|
||||||
aN.Reverse();
|
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
//=======================================================================
|
|
||||||
//function : RemovePCurveForEdgeOnFace
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void BOPTools_AlgoTools2D::RemovePCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
|
||||||
const TopoDS_Face& aF)
|
|
||||||
{
|
|
||||||
BRep_Builder aBB;
|
|
||||||
Handle(Geom2d_Curve) aC2D;
|
|
||||||
Standard_Real aTol;
|
|
||||||
|
|
||||||
aTol=BRep_Tool::Tolerance(aE);
|
|
||||||
aBB.UpdateEdge(aE, aC2D, aF, aTol);
|
|
||||||
}
|
|
||||||
//=======================================================================
|
|
||||||
//function : MakeCurveOnSurface
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void BOPTools_AlgoTools2D::MakeCurveOnSurface (const TopoDS_Edge& aE,
|
|
||||||
const TopoDS_Face& aF,
|
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
|
||||||
Standard_Real& aFirst,
|
|
||||||
Standard_Real& aLast,
|
|
||||||
Standard_Real& aToler)
|
|
||||||
{
|
|
||||||
BOPTools_AlgoTools2D::Make2D(aE, aF, aC2D, aFirst, aLast, aToler);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : TangentOnEdge
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::TangentOnEdge(const Standard_Real par,
|
|
||||||
const TopoDS_Edge& E,
|
|
||||||
gp_Vec& Tg)
|
|
||||||
{
|
|
||||||
Standard_Boolean isdgE;
|
|
||||||
|
|
||||||
isdgE = BRep_Tool::Degenerated(E);
|
|
||||||
if (isdgE) {
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
if (!CheckEdgeLength(E)) {
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
BRepAdaptor_Curve BC(E);
|
|
||||||
//
|
//
|
||||||
// Body
|
return BRep_Tool_CurveOnSurface(aLocalEdge,S,l,First,Last,bToUpdate);
|
||||||
Standard_Real f, l, tolE, tolp;
|
|
||||||
Standard_Boolean onf, onl, inbounds;
|
|
||||||
|
|
||||||
f = BC.FirstParameter();
|
|
||||||
l = BC.LastParameter();
|
|
||||||
tolE = BC.Tolerance();
|
|
||||||
tolp = BC.Resolution(tolE);
|
|
||||||
|
|
||||||
onf = Abs(f-par)<tolp;
|
|
||||||
onl = Abs(l-par)<tolp;
|
|
||||||
inbounds = (f<par) && (par<l);
|
|
||||||
|
|
||||||
if ((!inbounds) && (!onf) && (!onl)) {
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
gp_Pnt aP;
|
|
||||||
|
|
||||||
BC.D1(par, aP, Tg);
|
|
||||||
Tg.Normalize();
|
|
||||||
|
|
||||||
return Standard_True;
|
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : TangentOnEdge
|
//function : BRep_Tool_CurveOnSurface
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::TangentOnEdge(const TopoDS_Edge& aE,
|
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
|
||||||
gp_Dir& DTg)
|
(const TopoDS_Edge& E,
|
||||||
|
const Handle(Geom_Surface)& S,
|
||||||
|
const TopLoc_Location& L,
|
||||||
|
Standard_Real& First,
|
||||||
|
Standard_Real& Last,
|
||||||
|
Standard_Boolean& bToUpdate)
|
||||||
{
|
{
|
||||||
Standard_Real aT;
|
static const Handle(Geom2d_Curve) nullPCurve;
|
||||||
gp_Vec aTg;
|
bToUpdate=Standard_False;
|
||||||
|
TopLoc_Location loc = L.Predivided(E.Location());
|
||||||
|
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
|
||||||
|
|
||||||
DTg.SetCoord(1.,0.,0.);
|
// find the representation
|
||||||
|
BRep_ListIteratorOfListOfCurveRepresentation itcr
|
||||||
|
((*((Handle(BRep_TEdge)*)&E.TShape()))->ChangeCurves());
|
||||||
|
|
||||||
aT= BOPTools_AlgoTools2D::IntermediatePoint (aE);
|
while (itcr.More()) {
|
||||||
Standard_Boolean bIsFound=BOPTools_AlgoTools2D::TangentOnEdge(aT, aE, aTg);
|
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
||||||
if (bIsFound) {
|
if (cr->IsCurveOnSurface(S,loc)) {
|
||||||
gp_Dir aDTmp(aTg);
|
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
|
||||||
DTg=aDTmp;
|
GC->Range(First,Last);
|
||||||
|
if (GC->IsCurveOnClosedSurface() && Eisreversed)
|
||||||
|
return GC->PCurve2();
|
||||||
|
else
|
||||||
|
return GC->PCurve();
|
||||||
|
}
|
||||||
|
itcr.Next();
|
||||||
|
}
|
||||||
|
|
||||||
|
// for planar surface and 3d curve try a projection
|
||||||
|
// modif 21-05-97 : for RectangularTrimmedSurface, try a projection
|
||||||
|
Handle(Geom_Plane) GP;
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) GRTS;
|
||||||
|
GRTS = Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
|
||||||
|
if(!GRTS.IsNull())
|
||||||
|
GP = Handle(Geom_Plane)::DownCast(GRTS->BasisSurface());
|
||||||
|
else
|
||||||
|
GP = Handle(Geom_Plane)::DownCast(S);
|
||||||
|
//fin modif du 21-05-97
|
||||||
|
|
||||||
|
if (!GP.IsNull()) {
|
||||||
|
|
||||||
|
Handle(GeomAdaptor_HCurve) HC;
|
||||||
|
Handle(GeomAdaptor_HSurface) HS;
|
||||||
|
|
||||||
|
HC = new GeomAdaptor_HCurve();
|
||||||
|
HS = new GeomAdaptor_HSurface();
|
||||||
|
|
||||||
|
TopLoc_Location LC;
|
||||||
|
|
||||||
|
Standard_Real f, l;// for those who call with (u,u).
|
||||||
|
Handle(Geom_Curve) C3d =
|
||||||
|
BRep_Tool::Curve(E,/*LC,*/f,l); // transforming plane instead of curve
|
||||||
|
// we can loose scale factor of Curve transformation (eap 13 May 2002)
|
||||||
|
|
||||||
|
LC = L/*.Predivided(LC)*/;
|
||||||
|
|
||||||
|
if (C3d.IsNull()) return nullPCurve;
|
||||||
|
|
||||||
|
Handle(Geom_Plane) Plane = GP;
|
||||||
|
if (!LC.IsIdentity()) {
|
||||||
|
const gp_Trsf& T = LC.Transformation();
|
||||||
|
Handle(Geom_Geometry) GPT = GP->Transformed(T);
|
||||||
|
Plane = *((Handle(Geom_Plane)*)&GPT);
|
||||||
|
}
|
||||||
|
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
|
||||||
|
GAS.Load(Plane);
|
||||||
|
|
||||||
|
Handle(Geom_Curve) ProjOnPlane =
|
||||||
|
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l),
|
||||||
|
Plane,
|
||||||
|
Plane->Position().Direction(),
|
||||||
|
Standard_True);
|
||||||
|
|
||||||
|
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
|
||||||
|
GAC.Load(ProjOnPlane);
|
||||||
|
|
||||||
|
ProjLib_ProjectedCurve Proj(HS,HC);
|
||||||
|
Handle(Geom2d_Curve) pc = Geom2dAdaptor::MakeCurve(Proj);
|
||||||
|
|
||||||
|
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
|
||||||
|
Handle(Geom2d_TrimmedCurve) TC =
|
||||||
|
(*((Handle(Geom2d_TrimmedCurve)*)&pc));
|
||||||
|
pc = TC->BasisCurve();
|
||||||
|
}
|
||||||
|
First = f; Last = l;
|
||||||
|
//
|
||||||
|
bToUpdate=Standard_True;
|
||||||
|
//
|
||||||
|
return pc;
|
||||||
}
|
}
|
||||||
return bIsFound;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
return nullPCurve;
|
||||||
//function : TangentOnVertex
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Boolean BOPTools_AlgoTools2D::TangentOnVertex (const TopoDS_Vertex& v,
|
|
||||||
const TopoDS_Vertex& vl,
|
|
||||||
const TopoDS_Edge& e,
|
|
||||||
gp_Vec& aVec)
|
|
||||||
// tg oriented INSIDE 1d(e)
|
|
||||||
// vl : last vertex of e
|
|
||||||
{
|
|
||||||
Standard_Boolean ok;
|
|
||||||
Standard_Real par;
|
|
||||||
gp_Vec tg;
|
|
||||||
|
|
||||||
par = BRep_Tool::Parameter(v, e);
|
|
||||||
ok =BOPTools_AlgoTools2D::TangentOnEdge (par, e, tg);
|
|
||||||
if (!ok) {
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
if (v.IsSame(vl)) {
|
|
||||||
tg.Reverse();
|
|
||||||
}
|
|
||||||
aVec=tg;
|
|
||||||
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : EdgeBounds
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void BOPTools_AlgoTools2D::EdgeBounds (const TopoDS_Edge& aE,
|
|
||||||
Standard_Real& aFirst,
|
|
||||||
Standard_Real& aLast)
|
|
||||||
{
|
|
||||||
BRepAdaptor_Curve aBC(aE);
|
|
||||||
aFirst= aBC.FirstParameter();
|
|
||||||
aLast = aBC.LastParameter();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
26
tests/bugs/modalg_5/bug24157_1
Normal file
26
tests/bugs/modalg_5/bug24157_1
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24157_x_512_solids_glued] b1
|
||||||
|
tcopy b1 b2
|
||||||
|
ttranslate b2 3. 4. 5.
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddcompound b1
|
||||||
|
baddcompound b2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 60 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
29
tests/bugs/modalg_5/bug24157_2
Normal file
29
tests/bugs/modalg_5/bug24157_2
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24157_x_512_solids_glued] b1
|
||||||
|
tcopy b1 b2
|
||||||
|
ttranslate b2 2. 2. 2.
|
||||||
|
tcopy b1 b3
|
||||||
|
ttranslate b3 4. 4. 4.
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddcompound b1
|
||||||
|
baddcompound b2
|
||||||
|
baddcompound b3
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 200 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
23
tests/bugs/modalg_5/bug24157_3
Normal file
23
tests/bugs/modalg_5/bug24157_3
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24157_x_512_solids] b1
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddcompound b1
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 15 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
68
tests/bugs/modalg_5/bug24157_4
Normal file
68
tests/bugs/modalg_5/bug24157_4
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
set aN 5
|
||||||
|
set aR1 10.
|
||||||
|
set aR2 4.
|
||||||
|
|
||||||
|
set aZ 0.
|
||||||
|
for {set i 0} {$i < $aN} {incr i} {
|
||||||
|
set aA ${i}*2.*pi/${aN}
|
||||||
|
set aX ${aR1}*cos(${aA})
|
||||||
|
set aY ${aR1}*sin(${aA})
|
||||||
|
vertex v1_${i} ${aX} ${aY} ${aZ}
|
||||||
|
|
||||||
|
set aA ${aA}+pi/${aN}
|
||||||
|
set aX ${aR2}*cos(${aA})
|
||||||
|
set aY ${aR2}*sin(${aA})
|
||||||
|
vertex v2_${i} ${aX} ${aY} ${aZ}
|
||||||
|
}
|
||||||
|
copy v1_0 v1_${aN}
|
||||||
|
|
||||||
|
set q {}
|
||||||
|
for {set i 0} {$i < $aN} {incr i} {
|
||||||
|
set j [expr $i + 1]
|
||||||
|
edge e1_${i} v1_${i} v2_${i}
|
||||||
|
lappend q e1_${i}
|
||||||
|
edge e2_${i} v2_${i} v1_${j}
|
||||||
|
lappend q e2_${i}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval wire w $q
|
||||||
|
mkplane bs w
|
||||||
|
#----------------------------
|
||||||
|
box b 700 820 1
|
||||||
|
explode b f
|
||||||
|
copy b_5 b1
|
||||||
|
|
||||||
|
set N 41
|
||||||
|
set q {}
|
||||||
|
for {set i 1} {$i < $N} {incr i} {
|
||||||
|
for {set j 1} {$j < $N} {incr j} {
|
||||||
|
tcopy bs bs_${i}_{$j}
|
||||||
|
ttranslate bs_${i}_{$j} [expr $i * 17.] [expr $j * 20.] 0.
|
||||||
|
lappend q bs_${i}_{$j}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
eval compound $q b2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddcompound b2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 30 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
75
tests/bugs/modalg_5/bug24157_5
Normal file
75
tests/bugs/modalg_5/bug24157_5
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
set L 300
|
||||||
|
set dL 10
|
||||||
|
set dS 10
|
||||||
|
|
||||||
|
box b $L $L 20
|
||||||
|
explode b f
|
||||||
|
copy b_5 b1
|
||||||
|
|
||||||
|
vertex v1 ${dS} -${dL} 0
|
||||||
|
vertex v2 ${dS} [expr ${L}+${dL}] 0
|
||||||
|
edge ex v1 v2
|
||||||
|
|
||||||
|
vertex v1 -${dL} $dS 0
|
||||||
|
vertex v2 [expr ${L}+${dL}] ${dS} 0
|
||||||
|
edge ey v1 v2
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
set cx {}
|
||||||
|
set N 29
|
||||||
|
set N1 [expr $N+1]
|
||||||
|
|
||||||
|
for {set i 0} {$i < $N} {incr i} {
|
||||||
|
tcopy ex ex$i
|
||||||
|
ttranslate ex$i [expr $i*${dS}] 0 0
|
||||||
|
lappend cx ex$i
|
||||||
|
}
|
||||||
|
|
||||||
|
for {set i 0} {$i < $N} {incr i} {
|
||||||
|
tcopy ey ey$i
|
||||||
|
ttranslate ey$i 0 [expr $i*${dS}] 0
|
||||||
|
lappend cx ey$i
|
||||||
|
}
|
||||||
|
|
||||||
|
pcylinder x 1 2
|
||||||
|
explode x e
|
||||||
|
tcopy x_3 ex
|
||||||
|
|
||||||
|
for {set i 0} {$i < $N1} {incr i} {
|
||||||
|
for {set j 0} {$j < $N1} {incr j} {
|
||||||
|
for {set k 0} {$k < 3} {incr k} {
|
||||||
|
for {set m 0} {$m < 3} {incr m} {
|
||||||
|
tcopy ex ex_${i}_${j}_${k}_${m}
|
||||||
|
ttranslate ex_${i}_${j}_${k}_${m} [expr $i*${dS}] [expr $j*${dS}] 0
|
||||||
|
ttranslate ex_${i}_${j}_${k}_${m} [expr 2+${k}*3] [expr 2+${m}*3] 0
|
||||||
|
lappend cx ex_${i}_${j}_${k}_${m}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval compound $cx b2
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddcompound b2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
bbuild result -t
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 100 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
52
tests/bugs/modalg_5/bug24157_6
Normal file
52
tests/bugs/modalg_5/bug24157_6
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
box b1 100 100 100
|
||||||
|
set cx {}
|
||||||
|
psphere sp 1.
|
||||||
|
explode sp f
|
||||||
|
copy sp_1 sp
|
||||||
|
|
||||||
|
set ds 2.5
|
||||||
|
set dS 10.
|
||||||
|
set aNbGroups 3
|
||||||
|
|
||||||
|
for {set N 0} {$N < ${aNbGroups}} {incr N} {
|
||||||
|
for {set K 0} {$K < ${aNbGroups}} {incr K} {
|
||||||
|
for {set M 0} {$M < ${aNbGroups}} {incr M} {
|
||||||
|
for {set n 0} {$n < 3} {incr n} {
|
||||||
|
for {set k 0} {$k < 3} {incr k} {
|
||||||
|
for {set m 0} {$m < 3} {incr m} {
|
||||||
|
tcopy sp sp_${N}_${K}_${M}_${n}_${k}_${m}
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} 2.5 2.5 2.5
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} [expr $k*${ds}] [expr $m*${ds}] [expr $n*${ds}]
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} [expr $M*${dS}] [expr $K*${dS}] [expr $N*${dS}]
|
||||||
|
lappend cx sp_${N}_${K}_${M}_${n}_${k}_${m}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
eval compound $cx b2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddcompound b2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 10 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
52
tests/bugs/modalg_5/bug24157_7
Normal file
52
tests/bugs/modalg_5/bug24157_7
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
box b1 100 100 100
|
||||||
|
set cx {}
|
||||||
|
psphere sp 1.
|
||||||
|
explode sp f
|
||||||
|
copy sp_1 sp
|
||||||
|
|
||||||
|
set ds 2.5
|
||||||
|
set dS 10.
|
||||||
|
set aNbGroups 4
|
||||||
|
|
||||||
|
for {set N 0} {$N < ${aNbGroups}} {incr N} {
|
||||||
|
for {set K 0} {$K < ${aNbGroups}} {incr K} {
|
||||||
|
for {set M 0} {$M < ${aNbGroups}} {incr M} {
|
||||||
|
for {set n 0} {$n < 3} {incr n} {
|
||||||
|
for {set k 0} {$k < 3} {incr k} {
|
||||||
|
for {set m 0} {$m < 3} {incr m} {
|
||||||
|
tcopy sp sp_${N}_${K}_${M}_${n}_${k}_${m}
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} 2.5 2.5 2.5
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} [expr $k*${ds}] [expr $m*${ds}] [expr $n*${ds}]
|
||||||
|
ttranslate sp_${N}_${K}_${M}_${n}_${k}_${m} [expr $M*${dS}] [expr $K*${dS}] [expr $N*${dS}]
|
||||||
|
lappend cx sp_${N}_${K}_${M}_${n}_${k}_${m}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
eval compound $cx b2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddcompound b2
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 100 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
53
tests/bugs/modalg_5/bug24157_8
Normal file
53
tests/bugs/modalg_5/bug24157_8
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
set N 19
|
||||||
|
set dX 2.
|
||||||
|
|
||||||
|
box b 100 100 100
|
||||||
|
|
||||||
|
explode b f
|
||||||
|
copy b_1 fx
|
||||||
|
copy b_3 fy
|
||||||
|
copy b_5 fz
|
||||||
|
|
||||||
|
set q {}
|
||||||
|
for {set j 1} {$j < $N} {incr j} {
|
||||||
|
tcopy fx fx_${j}
|
||||||
|
ttranslate fx_${j} [expr $j*$dX] 0. 0.
|
||||||
|
lappend q fx_${j}
|
||||||
|
}
|
||||||
|
|
||||||
|
for {set j 1} {$j < $N} {incr j} {
|
||||||
|
tcopy fy fy_${j}
|
||||||
|
ttranslate fy_${j} 0. [expr $j*$dX] 0.
|
||||||
|
lappend q fy_${j}
|
||||||
|
}
|
||||||
|
|
||||||
|
for {set j 1} {$j < $N} {incr j} {
|
||||||
|
tcopy fz fz_${j}
|
||||||
|
ttranslate fz_${j} 0. 0. [expr $j*$dX]
|
||||||
|
lappend q fz_${j}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval compound $q b1
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddcompound b1
|
||||||
|
bfillds -t
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 2.9 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
33
tests/bugs/modalg_5/bug24157_9
Normal file
33
tests/bugs/modalg_5/bug24157_9
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24157"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################
|
||||||
|
# Parallelization of assembly part of BO
|
||||||
|
############################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24157_fstar] b1
|
||||||
|
set qs {}
|
||||||
|
|
||||||
|
set N 24
|
||||||
|
for {set i 0} {$i < $N} {incr i} {
|
||||||
|
tcopy b1 b1_${i}
|
||||||
|
trotate b1_${i} 0. 0. 0. 0. 0. 1. [expr $i * 15.]
|
||||||
|
lappend qs b1_${i}
|
||||||
|
}
|
||||||
|
eval compound $qs q
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddcompound q
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
regexp { +Tps: +([-0-9.+eE]+)} [bbuild result -t] full tps_time
|
||||||
|
|
||||||
|
if { $tps_time > 15.7 } {
|
||||||
|
puts "Error: low performance"
|
||||||
|
} else {
|
||||||
|
puts "OK: high performance"
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user