mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0028165: Improve performance of Boolean Operations
1. Unification of the usage of the BRepAdaptor_Surface in Boolean Operations algorithm. For each face when it is necessary the Adaptor is initialized only once and stored in Context. For that purpose the new IntTools_Context::SurfaceAdaptor(const TopoDS_Face&) method has been implemented. To provide possibility to take the Adaptor from the context, the context has been added as a parameter in following methods: BOPTools_AlgoTools::MakePCurve() BOPTools_AlgoTools::Sence() BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace() BOPTools_AlgoTools2D::PointOnSurface BOPTools_AlgoTools2D::CurveOnSurface BOPTools_AlgoTools2D::AdjustPCurveOnFace BOPTools_AlgoTools2D::Make2D BOPTools_AlgoTools2D::MakePCurveOnFace BOPTools_AlgoTools3D::GetNormalToFaceOnEdge It is also possible now to pass the context into BOPAlgo_WireSplitter algorithm. Also, the new IntTools_Context::UVBounds(const TopoDS_Face&) method has been implemented to get the UV bounds of a face. 2. Additional improvement is a calculation of reduced intersection range only for the intersection type VERTEX during computation of Edge/Face interference. 3. The methods IntTools_EdgeFace::Prepare() and IntTools_EdgeFace::FindProjectableRoot() and the fields IntTools_EdgeFace::myProjectableRanges and IntTools_EdgeFace::myFClass2d have been removed as obsolete. 4. Test cases for the issue.
This commit is contained in:
parent
483ce1bd89
commit
51db017972
@ -348,6 +348,7 @@ void BOPAlgo_BuilderFace::PerformLoops()
|
|||||||
//
|
//
|
||||||
aWSp.SetWES(aWES);
|
aWSp.SetWES(aWES);
|
||||||
aWSp.SetRunParallel(myRunParallel);
|
aWSp.SetRunParallel(myRunParallel);
|
||||||
|
aWSp.SetContext(myContext);
|
||||||
aWSp.Perform();
|
aWSp.Perform();
|
||||||
iErr=aWSp.ErrorStatus();
|
iErr=aWSp.ErrorStatus();
|
||||||
if (iErr) {
|
if (iErr) {
|
||||||
@ -839,7 +840,7 @@ Standard_Boolean IsInside(const TopoDS_Shape& theHole,
|
|||||||
if (!BRep_Tool::Degenerated(aE)) {
|
if (!BRep_Tool::Degenerated(aE)) {
|
||||||
//
|
//
|
||||||
aT=BOPTools_AlgoTools2D::IntermediatePoint(aE);
|
aT=BOPTools_AlgoTools2D::IntermediatePoint(aE);
|
||||||
BOPTools_AlgoTools2D::PointOnSurface(aE, aF2, aT, aU, aV);
|
BOPTools_AlgoTools2D::PointOnSurface(aE, aF2, aT, aU, aV, theContext);
|
||||||
aP2D.SetCoord(aU, aV);
|
aP2D.SetCoord(aU, aV);
|
||||||
//
|
//
|
||||||
IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
|
IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
|
||||||
|
@ -715,7 +715,7 @@ void BOPAlgo_Builder::FillImagesFaces1()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aFSD=(*(TopoDS_Face*)(&myShapesSD.Find(aFSp)));
|
aFSD=(*(TopoDS_Face*)(&myShapesSD.Find(aFSp)));
|
||||||
iSense=BOPTools_AlgoTools::Sense(aFSp, aFSD);
|
iSense=BOPTools_AlgoTools::Sense(aFSp, aFSD, myContext);
|
||||||
if (iSense<0) {
|
if (iSense<0) {
|
||||||
aFSD.Reverse();
|
aFSD.Reverse();
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ BOPDS_PDS BOPAlgo_PaveFiller::PDS()
|
|||||||
//function : Context
|
//function : Context
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(IntTools_Context) BOPAlgo_PaveFiller::Context()
|
const Handle(IntTools_Context)& BOPAlgo_PaveFiller::Context()
|
||||||
{
|
{
|
||||||
return myContext;
|
return myContext;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT const BOPCol_ListOfShape& Arguments() const;
|
Standard_EXPORT const BOPCol_ListOfShape& Arguments() const;
|
||||||
|
|
||||||
Standard_EXPORT Handle(IntTools_Context) Context();
|
Standard_EXPORT const Handle(IntTools_Context)& Context();
|
||||||
|
|
||||||
Standard_EXPORT void SetSectionAttribute (const BOPAlgo_SectionAttribute& theSecAttr);
|
Standard_EXPORT void SetSectionAttribute (const BOPAlgo_SectionAttribute& theSecAttr);
|
||||||
|
|
||||||
|
@ -243,6 +243,7 @@ void BOPAlgo_PaveFiller::PerformVZ()
|
|||||||
Standard_Boolean bJustAdd;
|
Standard_Boolean bJustAdd;
|
||||||
Standard_Integer iSize, nV, nZ, k, aNbVVS;
|
Standard_Integer iSize, nV, nZ, k, aNbVVS;
|
||||||
TopAbs_State aState;
|
TopAbs_State aState;
|
||||||
|
BOPDS_MapOfPassKey aMPK;
|
||||||
//
|
//
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
//
|
//
|
||||||
@ -263,11 +264,21 @@ void BOPAlgo_PaveFiller::PerformVZ()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
|
if (myDS->HasInterfShapeSubShapes(nV, nZ)) {
|
||||||
const BOPDS_ShapeInfo& aSIZ=myDS->ShapeInfo(nZ);
|
continue;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape());
|
Standard_Integer nVSD = nV;
|
||||||
const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape());
|
myDS->HasShapeSD(nV, nVSD);
|
||||||
|
//
|
||||||
|
BOPDS_PassKey aPK;
|
||||||
|
aPK.SetIds(nVSD, nZ);
|
||||||
|
if (!aMPK.Add(aPK)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&myDS->Shape(nVSD));
|
||||||
|
const TopoDS_Solid& aZ=*((TopoDS_Solid*)&myDS->Shape(nZ));
|
||||||
//
|
//
|
||||||
BOPAlgo_VertexSolid& aVertexSolid=aVVS.Append1();
|
BOPAlgo_VertexSolid& aVertexSolid=aVVS.Append1();
|
||||||
aVertexSolid.SetIndices(nV, nZ);
|
aVertexSolid.SetIndices(nV, nZ);
|
||||||
|
@ -427,6 +427,11 @@ void BOPAlgo_PaveFiller::PerformEE()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
const IntTools_SequenceOfCommonPrts& aCPrts = anEdgeEdge.CommonParts();
|
||||||
|
aNbCPrts = aCPrts.Length();
|
||||||
|
if (!aNbCPrts) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
Handle(BOPDS_PaveBlock)& aPB1=anEdgeEdge.PaveBlock1();
|
Handle(BOPDS_PaveBlock)& aPB1=anEdgeEdge.PaveBlock1();
|
||||||
nE1=aPB1->OriginalEdge();
|
nE1=aPB1->OriginalEdge();
|
||||||
@ -456,11 +461,8 @@ void BOPAlgo_PaveFiller::PerformEE()
|
|||||||
IntTools_Range aR11(aT11, aTS11), aR12(aTS12, aT12),
|
IntTools_Range aR11(aT11, aTS11), aR12(aTS12, aT12),
|
||||||
aR21(aT21, aTS21), aR22(aTS22, aT22);
|
aR21(aT21, aTS21), aR22(aTS22, aT22);
|
||||||
//
|
//
|
||||||
const IntTools_SequenceOfCommonPrts& aCPrts = anEdgeEdge.CommonParts();
|
|
||||||
aNbCPrts = aCPrts.Length();
|
|
||||||
//
|
|
||||||
Standard_Boolean bAnalytical = Standard_False;
|
Standard_Boolean bAnalytical = Standard_False;
|
||||||
if (aNbCPrts) {
|
{
|
||||||
const TopoDS_Edge& aOE1 = *(TopoDS_Edge*)&myDS->Shape(nE1);
|
const TopoDS_Edge& aOE1 = *(TopoDS_Edge*)&myDS->Shape(nE1);
|
||||||
const TopoDS_Edge& aOE2 = *(TopoDS_Edge*)&myDS->Shape(nE2);
|
const TopoDS_Edge& aOE2 = *(TopoDS_Edge*)&myDS->Shape(nE2);
|
||||||
//
|
//
|
||||||
|
@ -273,7 +273,13 @@ void BOPAlgo_PaveFiller::PerformEF()
|
|||||||
if (!aEdgeFace.IsDone()) {
|
if (!aEdgeFace.IsDone()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//~~~
|
//
|
||||||
|
const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
|
||||||
|
aNbCPrts = aCPrts.Length();
|
||||||
|
if (!aNbCPrts) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
aEdgeFace.Indices(nE, nF);
|
aEdgeFace.Indices(nE, nF);
|
||||||
//
|
//
|
||||||
const TopoDS_Edge& aE=aEdgeFace.Edge();
|
const TopoDS_Edge& aE=aEdgeFace.Edge();
|
||||||
@ -290,29 +296,27 @@ void BOPAlgo_PaveFiller::PerformEF()
|
|||||||
//
|
//
|
||||||
anewSR.Range(aTS1, aTS2);
|
anewSR.Range(aTS1, aTS2);
|
||||||
//
|
//
|
||||||
|
if (aCPrts(1).Type() == TopAbs_VERTEX) {
|
||||||
|
// for the intersection type VERTEX
|
||||||
// extend vertices ranges using Edge/Edge intersections
|
// extend vertices ranges using Edge/Edge intersections
|
||||||
// between the edge aE and the edges of the face aF.
|
// between the edge aE and the edges of the face aF.
|
||||||
// thereby the edge's intersection range is reduced
|
// thereby the edge's intersection range is reduced
|
||||||
ReduceIntersectionRange(nV[0], nV[1], nE, nF, aTS1, aTS2);
|
ReduceIntersectionRange(nV[0], nV[1], nE, nF, aTS1, aTS2);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
IntTools_Range aR1(aT1, aTS1), aR2(aTS2, aT2);
|
IntTools_Range aR1(aT1, aTS1), aR2(aTS2, aT2);
|
||||||
//
|
//
|
||||||
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
|
BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
|
||||||
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
|
const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
|
||||||
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
|
const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
|
||||||
//~~~
|
|
||||||
const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
|
|
||||||
aNbCPrts = aCPrts.Length();
|
|
||||||
//
|
//
|
||||||
Standard_Boolean bLinePlane = Standard_False;
|
Standard_Boolean bLinePlane = Standard_False;
|
||||||
if (aNbCPrts) {
|
if (aNbCPrts) {
|
||||||
BRepAdaptor_Curve aBAC(aE);
|
BRepAdaptor_Curve aBAC(aE);
|
||||||
BRepAdaptor_Surface aBAS(aF, Standard_False);
|
|
||||||
//
|
|
||||||
bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
|
bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
|
||||||
aBAS.GetType() == GeomAbs_Plane);
|
myContext->SurfaceAdaptor(aF).GetType() == GeomAbs_Plane);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
for (i=1; i<=aNbCPrts; ++i) {
|
for (i=1; i<=aNbCPrts; ++i) {
|
||||||
const IntTools_CommonPrt& aCPart=aCPrts(i);
|
const IntTools_CommonPrt& aCPart=aCPrts(i);
|
||||||
aType=aCPart.Type();
|
aType=aCPart.Type();
|
||||||
@ -766,6 +770,10 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const Standard_Integer theV1,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
if (!myDS->HasInterfShapeSubShapes(theE, theF)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
|
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
|
||||||
Standard_Integer aNbEEs = aEEs.Extent();
|
Standard_Integer aNbEEs = aEEs.Extent();
|
||||||
if (!aNbEEs) {
|
if (!aNbEEs) {
|
||||||
|
@ -189,7 +189,6 @@ void BOPAlgo_PaveFiller::PerformFF()
|
|||||||
Standard_Integer nF1, nF2, aNbCurves, aNbPoints, i, aNbLP;
|
Standard_Integer nF1, nF2, aNbCurves, aNbPoints, i, aNbLP;
|
||||||
Standard_Integer aNbFaceFace, k;
|
Standard_Integer aNbFaceFace, k;
|
||||||
Standard_Real aApproxTol, aTolR3D, aTolR2D, aTolFF, aTolReal;
|
Standard_Real aApproxTol, aTolR3D, aTolR2D, aTolFF, aTolReal;
|
||||||
BRepAdaptor_Surface aBAS1, aBAS2;
|
|
||||||
BOPCol_MapOfInteger aMI;
|
BOPCol_MapOfInteger aMI;
|
||||||
BOPAlgo_VectorOfFaceFace aVFaceFace;
|
BOPAlgo_VectorOfFaceFace aVFaceFace;
|
||||||
//
|
//
|
||||||
@ -220,8 +219,8 @@ void BOPAlgo_PaveFiller::PerformFF()
|
|||||||
myDS->UpdateFaceInfoIn(nF2);
|
myDS->UpdateFaceInfoIn(nF2);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aBAS1.Initialize(aF1, Standard_False);
|
const BRepAdaptor_Surface& aBAS1 = myContext->SurfaceAdaptor(aF1);
|
||||||
aBAS2.Initialize(aF2, Standard_False);
|
const BRepAdaptor_Surface& aBAS2 = myContext->SurfaceAdaptor(aF2);
|
||||||
if (aBAS1.GetType() == GeomAbs_Plane &&
|
if (aBAS1.GetType() == GeomAbs_Plane &&
|
||||||
aBAS2.GetType() == GeomAbs_Plane) {
|
aBAS2.GetType() == GeomAbs_Plane) {
|
||||||
Standard_Boolean bToIntersect;
|
Standard_Boolean bToIntersect;
|
||||||
@ -613,7 +612,8 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
// Make p-curves
|
// Make p-curves
|
||||||
BOPTools_AlgoTools::MakePCurve(aES, aF1, aF2, aIC,
|
BOPTools_AlgoTools::MakePCurve(aES, aF1, aF2, aIC,
|
||||||
mySectionAttribute.PCurveOnS1(),
|
mySectionAttribute.PCurveOnS1(),
|
||||||
mySectionAttribute.PCurveOnS2());
|
mySectionAttribute.PCurveOnS2(),
|
||||||
|
myContext);
|
||||||
//
|
//
|
||||||
// Append the Pave Block to the Curve j
|
// Append the Pave Block to the Curve j
|
||||||
aLPBC.Append(aPB);
|
aLPBC.Append(aPB);
|
||||||
|
@ -258,7 +258,7 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (iErr) {
|
if (iErr) {
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(myE, myF);
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(myE, myF, myContext);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (myFlag) {
|
if (myFlag) {
|
||||||
|
@ -79,6 +79,22 @@ BOPAlgo_WireEdgeSet& BOPAlgo_WireSplitter::WES()
|
|||||||
return *myWES;
|
return *myWES;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
//function : SetContext
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BOPAlgo_WireSplitter::SetContext(const Handle(IntTools_Context)& theContext)
|
||||||
|
{
|
||||||
|
myContext = theContext;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Context
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const Handle(IntTools_Context)& BOPAlgo_WireSplitter::Context()
|
||||||
|
{
|
||||||
|
return myContext;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
// function: CheckData
|
// function: CheckData
|
||||||
// purpose:
|
// purpose:
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -103,6 +119,11 @@ void BOPAlgo_WireSplitter::Perform()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
// create a context
|
||||||
|
if (myContext.IsNull()) {
|
||||||
|
myContext = new IntTools_Context;
|
||||||
|
}
|
||||||
|
//
|
||||||
MakeConnexityBlocks();
|
MakeConnexityBlocks();
|
||||||
MakeWires();
|
MakeWires();
|
||||||
}
|
}
|
||||||
@ -251,56 +272,59 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
class BOPAlgo_WS_ConnexityBlock {
|
||||||
|
public:
|
||||||
|
BOPAlgo_WS_ConnexityBlock() {};
|
||||||
|
~BOPAlgo_WS_ConnexityBlock() {};
|
||||||
|
|
||||||
typedef BOPCol_NCVector<BOPTools_ConnexityBlock> \
|
void SetFace(const TopoDS_Face& theF) {
|
||||||
BOPTools_VectorOfConnexityBlock;
|
myFace = theF;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TopoDS_Face& Face() const {
|
||||||
|
return myFace;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetConnexityBlock(const BOPTools_ConnexityBlock& theCB) {
|
||||||
|
myCB = theCB;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BOPTools_ConnexityBlock& ConnexityBlock() const {
|
||||||
|
return myCB;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetContext(const Handle(IntTools_Context)& aContext) {
|
||||||
|
myContext = aContext;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const Handle(IntTools_Context)& Context()const {
|
||||||
|
return myContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Perform() {
|
||||||
|
BOPAlgo_WireSplitter::SplitBlock(myFace, myCB, myContext);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//class : WireSplitterFunctor
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
class BOPAlgo_WireSplitterFunctor
|
|
||||||
{
|
|
||||||
protected:
|
protected:
|
||||||
TopoDS_Face myFace;
|
TopoDS_Face myFace;
|
||||||
BOPTools_VectorOfConnexityBlock* myPVCB;
|
BOPTools_ConnexityBlock myCB;
|
||||||
|
Handle(IntTools_Context) myContext;
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
typedef BOPCol_NCVector<BOPAlgo_WS_ConnexityBlock> \
|
||||||
|
BOPAlgo_VectorOfConnexityBlock;
|
||||||
//
|
//
|
||||||
BOPAlgo_WireSplitterFunctor(const TopoDS_Face& aF,
|
typedef BOPCol_ContextFunctor
|
||||||
BOPTools_VectorOfConnexityBlock& aVCB)
|
<BOPAlgo_WS_ConnexityBlock,
|
||||||
: myFace(aF), myPVCB(&aVCB)
|
BOPAlgo_VectorOfConnexityBlock,
|
||||||
{
|
Handle(IntTools_Context),
|
||||||
}
|
IntTools_Context> BOPAlgo_SplitBlockFunctor;
|
||||||
//
|
//
|
||||||
void operator()( const Standard_Integer& theIndex ) const
|
typedef BOPCol_ContextCnt
|
||||||
{
|
<BOPAlgo_SplitBlockFunctor,
|
||||||
BOPTools_VectorOfConnexityBlock& aVCB = *myPVCB;
|
BOPAlgo_VectorOfConnexityBlock,
|
||||||
BOPTools_ConnexityBlock& aCB = aVCB(theIndex);
|
Handle(IntTools_Context)> BOPAlgo_SplitBlockCnt;
|
||||||
BOPAlgo_WireSplitter::SplitBlock(myFace, aCB);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//=======================================================================
|
|
||||||
//class : BOPAlgo_WireSplitterCnt
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
class BOPAlgo_WireSplitterCnt
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//-------------------------------
|
|
||||||
// Perform
|
|
||||||
Standard_EXPORT
|
|
||||||
static void Perform(const Standard_Boolean bRunParallel,
|
|
||||||
const TopoDS_Face& aF,
|
|
||||||
BOPTools_VectorOfConnexityBlock& aVCB)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
BOPAlgo_WireSplitterFunctor aWSF(aF, aVCB);
|
|
||||||
Standard_Integer aNbVCB = aVCB.Extent();
|
|
||||||
//
|
|
||||||
OSD_Parallel::For(0, aNbVCB, aWSF, !bRunParallel);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MakeWires
|
//function : MakeWires
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -312,7 +336,9 @@ void BOPAlgo_WireSplitter::MakeWires()
|
|||||||
TopoDS_Wire aW;
|
TopoDS_Wire aW;
|
||||||
BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
|
BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
|
||||||
BOPCol_ListIteratorOfListOfShape aIt;
|
BOPCol_ListIteratorOfListOfShape aIt;
|
||||||
BOPTools_VectorOfConnexityBlock aVCB;
|
BOPAlgo_VectorOfConnexityBlock aVCB;
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aF=myWES->Face();
|
||||||
//
|
//
|
||||||
aItCB.Initialize(myLCB);
|
aItCB.Initialize(myLCB);
|
||||||
for (; aItCB.More(); aItCB.Next()) {
|
for (; aItCB.More(); aItCB.Next()) {
|
||||||
@ -324,18 +350,18 @@ void BOPAlgo_WireSplitter::MakeWires()
|
|||||||
myWES->AddShape(aW);
|
myWES->AddShape(aW);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aVCB.Append(aCB);
|
BOPAlgo_WS_ConnexityBlock& aWSCB = aVCB.Append1();
|
||||||
|
aWSCB.SetFace(aF);
|
||||||
|
aWSCB.SetConnexityBlock(aCB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//===================================================
|
||||||
|
BOPAlgo_SplitBlockCnt::Perform(myRunParallel, aVCB, myContext);
|
||||||
|
//===================================================
|
||||||
aNbVCB=aVCB.Extent();
|
aNbVCB=aVCB.Extent();
|
||||||
const TopoDS_Face& aF=myWES->Face();
|
|
||||||
//===================================================
|
|
||||||
BOPAlgo_WireSplitterCnt::Perform(myRunParallel, aF, aVCB);
|
|
||||||
//===================================================
|
|
||||||
for (k=0; k<aNbVCB; ++k) {
|
for (k=0; k<aNbVCB; ++k) {
|
||||||
const BOPTools_ConnexityBlock& aCB=aVCB(k);
|
const BOPAlgo_WS_ConnexityBlock& aCB=aVCB(k);
|
||||||
const BOPCol_ListOfShape& aLW=aCB.Loops();
|
const BOPCol_ListOfShape& aLW=aCB.ConnexityBlock().Loops();
|
||||||
aIt.Initialize(aLW);
|
aIt.Initialize(aLW);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
const TopoDS_Shape& aWx=aIt.Value();
|
const TopoDS_Shape& aWx=aIt.Value();
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
#include <BOPCol_BaseAllocator.hxx>
|
#include <BOPCol_BaseAllocator.hxx>
|
||||||
#include <BOPCol_ListOfShape.hxx>
|
#include <BOPCol_ListOfShape.hxx>
|
||||||
#include <BOPTools_ConnexityBlock.hxx>
|
#include <BOPTools_ConnexityBlock.hxx>
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
class BOPAlgo_WireEdgeSet;
|
class BOPAlgo_WireEdgeSet;
|
||||||
class TopoDS_Wire;
|
class TopoDS_Wire;
|
||||||
class TopoDS_Face;
|
class TopoDS_Face;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BOPAlgo_WireSplitter : public BOPAlgo_Algo
|
class BOPAlgo_WireSplitter : public BOPAlgo_Algo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -47,42 +47,36 @@ Standard_EXPORT virtual ~BOPAlgo_WireSplitter();
|
|||||||
|
|
||||||
Standard_EXPORT BOPAlgo_WireEdgeSet& WES();
|
Standard_EXPORT BOPAlgo_WireEdgeSet& WES();
|
||||||
|
|
||||||
|
//! Sets the context for the algorithm
|
||||||
|
Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext);
|
||||||
|
|
||||||
|
//! Returns the context
|
||||||
|
Standard_EXPORT const Handle(IntTools_Context)& Context();
|
||||||
|
|
||||||
Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
|
Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
|
||||||
|
|
||||||
static void MakeWire(BOPCol_ListOfShape& theLE, TopoDS_Wire& theW);
|
static void MakeWire(BOPCol_ListOfShape& theLE, TopoDS_Wire& theW);
|
||||||
|
|
||||||
Standard_EXPORT static void SplitBlock (const TopoDS_Face& theF, BOPTools_ConnexityBlock& theCB);
|
Standard_EXPORT static void SplitBlock (const TopoDS_Face& theF,
|
||||||
|
BOPTools_ConnexityBlock& theCB,
|
||||||
|
const Handle(IntTools_Context)& theContext);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
|
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
|
||||||
|
|
||||||
Standard_EXPORT void MakeConnexityBlocks();
|
Standard_EXPORT void MakeConnexityBlocks();
|
||||||
|
|
||||||
Standard_EXPORT void MakeWires();
|
Standard_EXPORT void MakeWires();
|
||||||
|
|
||||||
|
|
||||||
BOPAlgo_PWireEdgeSet myWES;
|
BOPAlgo_PWireEdgeSet myWES;
|
||||||
BOPTools_ListOfConnexityBlock myLCB;
|
BOPTools_ListOfConnexityBlock myLCB;
|
||||||
|
Handle(IntTools_Context) myContext;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#include <BOPAlgo_WireSplitter.lxx>
|
#include <BOPAlgo_WireSplitter.lxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _BOPAlgo_WireSplitter_HeaderFile
|
#endif // _BOPAlgo_WireSplitter_HeaderFile
|
||||||
|
@ -62,7 +62,8 @@ static
|
|||||||
const TopoDS_Edge& anEdge,
|
const TopoDS_Edge& anEdge,
|
||||||
const TopoDS_Face& myFace,
|
const TopoDS_Face& myFace,
|
||||||
const GeomAdaptor_Surface& aGAS,
|
const GeomAdaptor_Surface& aGAS,
|
||||||
const Standard_Boolean aFlag);
|
const Standard_Boolean aFlag,
|
||||||
|
const Handle(IntTools_Context)& theContext);
|
||||||
|
|
||||||
static
|
static
|
||||||
void GetNextVertex(const TopoDS_Vertex& aV,
|
void GetNextVertex(const TopoDS_Vertex& aV,
|
||||||
@ -121,14 +122,16 @@ static
|
|||||||
static
|
static
|
||||||
void RefineAngles(const TopoDS_Face& myFace,
|
void RefineAngles(const TopoDS_Face& myFace,
|
||||||
const BOPCol_ListOfShape&,
|
const BOPCol_ListOfShape&,
|
||||||
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo&);
|
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo&,
|
||||||
|
const Handle(IntTools_Context)&);
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
void RefineAngles(const TopoDS_Vertex& ,
|
void RefineAngles(const TopoDS_Vertex& ,
|
||||||
const TopoDS_Face& ,
|
const TopoDS_Face& ,
|
||||||
const BOPCol_MapOfShape& ,
|
const BOPCol_MapOfShape& ,
|
||||||
BOPAlgo_ListOfEdgeInfo& );
|
BOPAlgo_ListOfEdgeInfo&,
|
||||||
|
const Handle(IntTools_Context)&);
|
||||||
|
|
||||||
static
|
static
|
||||||
Standard_Boolean RefineAngle2D(const TopoDS_Vertex& ,
|
Standard_Boolean RefineAngle2D(const TopoDS_Vertex& ,
|
||||||
@ -136,14 +139,16 @@ static
|
|||||||
const TopoDS_Face& ,
|
const TopoDS_Face& ,
|
||||||
const Standard_Real ,
|
const Standard_Real ,
|
||||||
const Standard_Real ,
|
const Standard_Real ,
|
||||||
Standard_Real& );
|
Standard_Real& ,
|
||||||
|
const Handle(IntTools_Context)& );
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SplitBlock
|
//function : SplitBlock
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
|
void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
|
||||||
BOPTools_ConnexityBlock& aCB)
|
BOPTools_ConnexityBlock& aCB,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Boolean bNothingToDo, bIsClosed, bIsIN;
|
Standard_Boolean bNothingToDo, bIsClosed, bIsIN;
|
||||||
Standard_Integer aIx, aNb, i, aCntIn, aCntOut;
|
Standard_Integer aIx, aNb, i, aCntIn, aCntOut;
|
||||||
@ -287,7 +292,7 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// 3. Angles in mySmartMap
|
// 3. Angles in mySmartMap
|
||||||
BRepAdaptor_Surface aBAS(myFace);
|
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(myFace);
|
||||||
const GeomAdaptor_Surface& aGAS=aBAS.Surface();
|
const GeomAdaptor_Surface& aGAS=aBAS.Surface();
|
||||||
//
|
//
|
||||||
for (i=1; i<=aNb; i++) {
|
for (i=1; i<=aNb; i++) {
|
||||||
@ -302,15 +307,15 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
|
|||||||
bIsIN = aEI.IsIn();
|
bIsIN = aEI.IsIn();
|
||||||
aOr = bIsIN ? TopAbs_REVERSED : TopAbs_FORWARD;
|
aOr = bIsIN ? TopAbs_REVERSED : TopAbs_FORWARD;
|
||||||
aVV.Orientation(aOr);
|
aVV.Orientation(aOr);
|
||||||
aAngle = Angle2D(aVV, aE, myFace, aGAS, bIsIN);
|
aAngle = Angle2D(aVV, aE, myFace, aGAS, bIsIN, theContext);
|
||||||
aEI.SetAngle(aAngle);
|
aEI.SetAngle(aAngle);
|
||||||
}
|
}
|
||||||
}// for (i=1; i<=aNb; i++) {
|
}// for (i=1; i<=aNb; i++) {
|
||||||
//
|
//
|
||||||
//Theme: The treatment p-curves convergent in node.
|
//Theme: The treatment p-curves convergent in node.
|
||||||
//The refining the angles of p-curves taking into account
|
//The refining the angles of p-curves taking into account
|
||||||
//bounging curves if exist.
|
//bounding curves if exist.
|
||||||
RefineAngles(myFace, myEdges, mySmartMap);
|
RefineAngles(myFace, myEdges, mySmartMap, theContext);
|
||||||
//
|
//
|
||||||
// 4. Do
|
// 4. Do
|
||||||
//
|
//
|
||||||
@ -712,7 +717,8 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
|
|||||||
const TopoDS_Edge& anEdge,
|
const TopoDS_Edge& anEdge,
|
||||||
const TopoDS_Face& myFace,
|
const TopoDS_Face& myFace,
|
||||||
const GeomAdaptor_Surface& aGAS,
|
const GeomAdaptor_Surface& aGAS,
|
||||||
const Standard_Boolean bIsIN)
|
const Standard_Boolean bIsIN,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aFirst, aLast, aToler, dt, aTV, aTV1, anAngle, aTX;
|
Standard_Real aFirst, aLast, aToler, dt, aTV, aTV1, anAngle, aTX;
|
||||||
gp_Pnt2d aPV, aPV1;
|
gp_Pnt2d aPV, aPV1;
|
||||||
@ -725,7 +731,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface (anEdge, myFace, aC2D,
|
BOPTools_AlgoTools2D::CurveOnSurface (anEdge, myFace, aC2D,
|
||||||
aFirst, aLast, aToler);
|
aFirst, aLast, aToler, theContext);
|
||||||
Standard_Real tol2d =2.*Tolerance2D(aV, aGAS);
|
Standard_Real tol2d =2.*Tolerance2D(aV, aGAS);
|
||||||
//
|
//
|
||||||
GeomAbs_CurveType aType;
|
GeomAbs_CurveType aType;
|
||||||
@ -849,7 +855,8 @@ Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void RefineAngles(const TopoDS_Face& myFace,
|
void RefineAngles(const TopoDS_Face& myFace,
|
||||||
const BOPCol_ListOfShape& myEdges,
|
const BOPCol_ListOfShape& myEdges,
|
||||||
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap)
|
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Integer aNb, i;
|
Standard_Integer aNb, i;
|
||||||
BOPCol_IndexedDataMapOfShapeInteger aMSI;
|
BOPCol_IndexedDataMapOfShapeInteger aMSI;
|
||||||
@ -886,7 +893,7 @@ void RefineAngles(const TopoDS_Face& myFace,
|
|||||||
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&mySmartMap.FindKey(i));
|
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&mySmartMap.FindKey(i));
|
||||||
BOPAlgo_ListOfEdgeInfo& aLEI=mySmartMap(i);
|
BOPAlgo_ListOfEdgeInfo& aLEI=mySmartMap(i);
|
||||||
//
|
//
|
||||||
RefineAngles(aV, myFace, aMBE, aLEI);
|
RefineAngles(aV, myFace, aMBE, aLEI, theContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -903,7 +910,8 @@ typedef BOPCol_DataMapOfShapeReal::Iterator \
|
|||||||
void RefineAngles(const TopoDS_Vertex& aV,
|
void RefineAngles(const TopoDS_Vertex& aV,
|
||||||
const TopoDS_Face& myFace,
|
const TopoDS_Face& myFace,
|
||||||
const BOPCol_MapOfShape& aMBE,
|
const BOPCol_MapOfShape& aMBE,
|
||||||
BOPAlgo_ListOfEdgeInfo& aLEI)
|
BOPAlgo_ListOfEdgeInfo& aLEI,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Boolean bIsIn, bIsBoundary, bRefined;
|
Standard_Boolean bIsIn, bIsBoundary, bRefined;
|
||||||
Standard_Integer iCntBnd, iCntInt;
|
Standard_Integer iCntBnd, iCntInt;
|
||||||
@ -956,7 +964,7 @@ void RefineAngles(const TopoDS_Vertex& aV,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
bRefined=RefineAngle2D(aV, aE, myFace, aA1, aA2, aA);
|
bRefined=RefineAngle2D(aV, aE, myFace, aA1, aA2, aA, theContext);
|
||||||
if (bRefined) {
|
if (bRefined) {
|
||||||
aDMSR.Bind(aE, aA);
|
aDMSR.Bind(aE, aA);
|
||||||
}
|
}
|
||||||
@ -999,7 +1007,8 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
|
|||||||
const TopoDS_Face& myFace,
|
const TopoDS_Face& myFace,
|
||||||
const Standard_Real aA1,
|
const Standard_Real aA1,
|
||||||
const Standard_Real aA2,
|
const Standard_Real aA2,
|
||||||
Standard_Real& aA)
|
Standard_Real& aA,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Boolean bRet;
|
Standard_Boolean bRet;
|
||||||
Standard_Integer i, j, aNbP;
|
Standard_Integer i, j, aNbP;
|
||||||
@ -1016,7 +1025,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
|
|||||||
aCf=0.01;
|
aCf=0.01;
|
||||||
aTolInt=1.e-10;
|
aTolInt=1.e-10;
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, myFace, aC2D, aT1, aT2, aTol);
|
BOPTools_AlgoTools2D::CurveOnSurface(aE, myFace, aC2D, aT1, aT2, aTol, theContext);
|
||||||
aGAC1.Load(aC2D, aT1, aT2);
|
aGAC1.Load(aC2D, aT1, aT2);
|
||||||
//
|
//
|
||||||
aTV=BRep_Tool::Parameter (aV, aE, myFace);
|
aTV=BRep_Tool::Parameter (aV, aE, myFace);
|
||||||
|
@ -1002,7 +1002,8 @@ Standard_Boolean BOPTools_AlgoTools::CheckSameGeom
|
|||||||
// purpose:
|
// purpose:
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
|
Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
|
||||||
const TopoDS_Face& theF2)
|
const TopoDS_Face& theF2,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Integer iSense=0;
|
Standard_Integer iSense=0;
|
||||||
gp_Dir aDNF1, aDNF2;
|
gp_Dir aDNF1, aDNF2;
|
||||||
@ -1036,8 +1037,8 @@ Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
|
|||||||
return iSense;
|
return iSense;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE1, theF1, aDNF1);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE1, theF1, aDNF1, theContext);
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE2, theF2, aDNF2);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE2, theF2, aDNF2, theContext);
|
||||||
//
|
//
|
||||||
iSense=BOPTools_AlgoTools3D::SenseFlag(aDNF1, aDNF2);
|
iSense=BOPTools_AlgoTools3D::SenseFlag(aDNF1, aDNF2);
|
||||||
//
|
//
|
||||||
@ -1357,7 +1358,8 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
|
|||||||
const TopoDS_Face& aF2,
|
const TopoDS_Face& aF2,
|
||||||
const IntTools_Curve& aIC,
|
const IntTools_Curve& aIC,
|
||||||
const Standard_Boolean bPC1,
|
const Standard_Boolean bPC1,
|
||||||
const Standard_Boolean bPC2)
|
const Standard_Boolean bPC2,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
@ -1392,19 +1394,19 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
|
|||||||
//
|
//
|
||||||
aC2D=aC2Dx1;
|
aC2D=aC2Dx1;
|
||||||
if (aC2D.IsNull()) {
|
if (aC2D.IsNull()) {
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aFFWD);
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aFFWD, theContext);
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFFWD, aC2D,
|
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFFWD, aC2D,
|
||||||
aOutFirst, aOutLast,
|
aOutFirst, aOutLast,
|
||||||
aOutTol);
|
aOutTol, theContext);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (aC3DE->IsPeriodic()) {
|
if (aC3DE->IsPeriodic()) {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
|
||||||
aC2DA);
|
aC2DA, theContext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D,
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D,
|
||||||
aC2DA);
|
aC2DA, theContext);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
|
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
|
||||||
@ -1809,7 +1811,7 @@ void GetFaceDir(const TopoDS_Edge& aE,
|
|||||||
Standard_Real aTolE;
|
Standard_Real aTolE;
|
||||||
gp_Pnt aPx;
|
gp_Pnt aPx;
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN, theContext);
|
||||||
if (aF.Orientation()==TopAbs_REVERSED){
|
if (aF.Orientation()==TopAbs_REVERSED){
|
||||||
aDN.Reverse();
|
aDN.Reverse();
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,15 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT static void MakeEdge (const IntTools_Curve& theCurve, const TopoDS_Vertex& theV1, const Standard_Real theT1, const TopoDS_Vertex& theV2, const Standard_Real theT2, const Standard_Real theTolR3D, TopoDS_Edge& theE);
|
Standard_EXPORT static void MakeEdge (const IntTools_Curve& theCurve, const TopoDS_Vertex& theV1, const Standard_Real theT1, const TopoDS_Vertex& theV2, const Standard_Real theT2, const Standard_Real theTolR3D, TopoDS_Edge& theE);
|
||||||
|
|
||||||
Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE, const TopoDS_Face& theF1, const TopoDS_Face& theF2, const IntTools_Curve& theCurve, const Standard_Boolean thePC1, const Standard_Boolean thePC2);
|
//! Makes 2d curve of the edge <theE> on the faces <theF1> and <theF2>.<br>
|
||||||
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE,
|
||||||
|
const TopoDS_Face& theF1,
|
||||||
|
const TopoDS_Face& theF2,
|
||||||
|
const IntTools_Curve& theCurve,
|
||||||
|
const Standard_Boolean thePC1,
|
||||||
|
const Standard_Boolean thePC2,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
|
Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
|
||||||
|
|
||||||
@ -88,7 +96,12 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT static Standard_Boolean CheckSameGeom (const TopoDS_Face& theF1, const TopoDS_Face& theF2, Handle(IntTools_Context)& theContext);
|
Standard_EXPORT static Standard_Boolean CheckSameGeom (const TopoDS_Face& theF1, const TopoDS_Face& theF2, Handle(IntTools_Context)& theContext);
|
||||||
|
|
||||||
Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2);
|
//! Basing on the normals directions of the faces the method
|
||||||
|
//! Defines whether to reverse the second face or not.<br>
|
||||||
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1,
|
||||||
|
const TopoDS_Face& theF2,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
//! Returns True if the face theFace contains
|
//! Returns True if the face theFace contains
|
||||||
//! the edge theEdge but with opposite orientation.
|
//! the edge theEdge but with opposite orientation.
|
||||||
|
@ -89,7 +89,8 @@ static
|
|||||||
//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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
BRep_Builder aBB;
|
BRep_Builder aBB;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
@ -104,7 +105,7 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF, aC2D, aTolPC);
|
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF, aC2D, aTolPC, theContext);
|
||||||
|
|
||||||
aTolEdge=BRep_Tool::Tolerance(aE);
|
aTolEdge=BRep_Tool::Tolerance(aE);
|
||||||
|
|
||||||
@ -159,14 +160,14 @@ 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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
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,
|
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D, aFirst, aLast, aToler, theContext);
|
||||||
aFirst, aLast, aToler);
|
|
||||||
aC2D->D0(aParameter, aP2D);
|
aC2D->D0(aParameter, aP2D);
|
||||||
U=aP2D.X();
|
U=aP2D.X();
|
||||||
V=aP2D.Y();
|
V=aP2D.Y();
|
||||||
@ -180,12 +181,12 @@ void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
|||||||
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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aFirst, aLast;
|
Standard_Real aFirst, aLast;
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D,
|
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF, aC2D, aFirst, aLast, aToler, theContext);
|
||||||
aFirst, aLast, aToler);
|
|
||||||
//
|
//
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -198,7 +199,8 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
|||||||
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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Boolean aHasOld;
|
Standard_Boolean aHasOld;
|
||||||
Handle(Geom2d_Curve) C2D;
|
Handle(Geom2d_Curve) C2D;
|
||||||
@ -211,7 +213,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOPTools_AlgoTools2D::Make2D(aE, aF, C2D, aFirst, aLast, aToler);
|
BOPTools_AlgoTools2D::Make2D(aE, aF, C2D, aFirst, aLast, aToler, theContext);
|
||||||
aC2D=C2D;
|
aC2D=C2D;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -247,7 +249,6 @@ Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
|||||||
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
||||||
(const TopoDS_Edge& aE,
|
(const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF)
|
const TopoDS_Face& aF)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Boolean bHasOld;
|
Standard_Boolean bHasOld;
|
||||||
Handle(Geom2d_Curve) aC2D;
|
Handle(Geom2d_Curve) aC2D;
|
||||||
@ -269,40 +270,46 @@ Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
||||||
(const TopoDS_Face& aF,
|
(const TopoDS_Face& theF,
|
||||||
const Handle(Geom_Curve)& aC3D,
|
const Handle(Geom_Curve)& theC3D,
|
||||||
const Handle(Geom2d_Curve)& aC2D,
|
const Handle(Geom2d_Curve)& theC2D,
|
||||||
Handle(Geom2d_Curve)& aC2DA)
|
Handle(Geom2d_Curve)& theC2DA,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aT1, aT2;
|
Standard_Real aT1 = theC3D->FirstParameter();
|
||||||
|
Standard_Real aT2 = theC3D->LastParameter();
|
||||||
//
|
//
|
||||||
aT1=aC3D->FirstParameter();
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace (theF, aT1, aT2, theC2D, theC2DA, theContext);
|
||||||
aT2=aC3D->LastParameter();
|
|
||||||
//
|
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aT1, aT2, aC2D, aC2DA);
|
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AdjustPCurveOnFace
|
//function : AdjustPCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
||||||
(const TopoDS_Face& aF,
|
(const TopoDS_Face& theF,
|
||||||
const Standard_Real aT1,
|
const Standard_Real theFirst,
|
||||||
const Standard_Real aT2,
|
const Standard_Real theLast,
|
||||||
const Handle(Geom2d_Curve)& aC2D,
|
const Handle(Geom2d_Curve)& theC2D,
|
||||||
Handle(Geom2d_Curve)& aC2DA)
|
Handle(Geom2d_Curve)& theC2DA,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
BRepAdaptor_Surface aBAS(aF, Standard_True);
|
BRepAdaptor_Surface aBASTmp;
|
||||||
//
|
const BRepAdaptor_Surface* pBAS;
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aBAS, aT1, aT2,
|
if (!theContext.IsNull()) {
|
||||||
aC2D, aC2DA);
|
pBAS = &theContext->SurfaceAdaptor(theF);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aBASTmp.Initialize(theF, Standard_True);
|
||||||
|
pBAS = &aBASTmp;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(*pBAS, theFirst, theLast, theC2D, theC2DA);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AdjustPCurveOnFace
|
//function : AdjustPCurveOnFace
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
|
||||||
(const BRepAdaptor_Surface& aBAS,
|
(const BRepAdaptor_Surface& aBAS,
|
||||||
const Standard_Real aFirst,
|
const Standard_Real aFirst,
|
||||||
const Standard_Real aLast,
|
const Standard_Real aLast,
|
||||||
@ -319,9 +326,6 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
|
|||||||
VMin=aBAS.FirstVParameter();
|
VMin=aBAS.FirstVParameter();
|
||||||
VMax=aBAS.LastVParameter();
|
VMax=aBAS.LastVParameter();
|
||||||
//
|
//
|
||||||
//BRepAdaptor_Surface aBAS(aF, Standard_False);
|
|
||||||
//BRepTools::UVBounds(aF, UMin, UMax, VMin, VMax);
|
|
||||||
//
|
|
||||||
aDelta=Precision::PConfusion();
|
aDelta=Precision::PConfusion();
|
||||||
|
|
||||||
aT =.5*(aFirst+aLast);
|
aT =.5*(aFirst+aLast);
|
||||||
@ -534,7 +538,8 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Boolean aLocIdentity;
|
Standard_Boolean aLocIdentity;
|
||||||
Standard_Real f3d, l3d;
|
Standard_Real f3d, l3d;
|
||||||
@ -569,7 +574,7 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
|
|
||||||
//
|
//
|
||||||
aToler = BRep_Tool::Tolerance(aE);
|
aToler = BRep_Tool::Tolerance(aE);
|
||||||
BOPTools_AlgoTools2D::MakePCurveOnFace(aF, C3D2, f3d, l3d, aC2D, aToler);
|
BOPTools_AlgoTools2D::MakePCurveOnFace(aF, C3D2, f3d, l3d, aC2D, aToler, theContext);
|
||||||
//
|
//
|
||||||
aFirst = f3d;
|
aFirst = f3d;
|
||||||
aLast = l3d;
|
aLast = l3d;
|
||||||
@ -582,7 +587,8 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
|||||||
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,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aFirst, aLast;
|
Standard_Real aFirst, aLast;
|
||||||
|
|
||||||
@ -591,8 +597,8 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
|||||||
//
|
//
|
||||||
TolReached2d=0.;
|
TolReached2d=0.;
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools2D::MakePCurveOnFace (aF, aC3D, aFirst,
|
BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||||
aLast, aC2D, TolReached2d);
|
(aF, aC3D, aFirst, aLast, aC2D, TolReached2d, theContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -605,29 +611,25 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
|||||||
const Standard_Real aT1,
|
const Standard_Real aT1,
|
||||||
const Standard_Real aT2,
|
const Standard_Real aT2,
|
||||||
Handle(Geom2d_Curve)& aC2D,
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
Standard_Real& TolReached2d)
|
Standard_Real& TolReached2d,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aTolR, aT;
|
BRepAdaptor_Surface aBASTmp;
|
||||||
Standard_Real aUMin, aUMax, aVMin, aVMax;
|
const BRepAdaptor_Surface* pBAS;
|
||||||
Handle(Geom2d_Curve) aC2DA;
|
if (!theContext.IsNull()) {
|
||||||
Handle(GeomAdaptor_HSurface) aBAHS;
|
pBAS = &theContext->SurfaceAdaptor(aF);
|
||||||
Handle(GeomAdaptor_HCurve) aBAHC;
|
}
|
||||||
Handle(Geom_Surface) aS;
|
else {
|
||||||
|
aBASTmp.Initialize(aF, Standard_True);
|
||||||
|
pBAS = &aBASTmp;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
BRepAdaptor_Surface aBAS(aF, Standard_True);
|
Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(*pBAS);
|
||||||
aUMin=aBAS.FirstUParameter();
|
Handle(GeomAdaptor_HCurve) aBAHC = new GeomAdaptor_HCurve(aC3D, aT1, aT2);
|
||||||
aUMax=aBAS.LastUParameter();
|
|
||||||
aVMin=aBAS.FirstVParameter();
|
|
||||||
aVMax=aBAS.LastVParameter();
|
|
||||||
aS=aBAS.Surface().Surface();
|
|
||||||
aS=Handle(Geom_Surface)::DownCast(aS->Transformed(aBAS.Trsf()));
|
|
||||||
GeomAdaptor_Surface aGAS(aS, aUMin, aUMax, aVMin, aVMax);
|
|
||||||
//
|
|
||||||
aBAHS=new GeomAdaptor_HSurface(aGAS);
|
|
||||||
aBAHC=new GeomAdaptor_HCurve(aC3D, aT1, aT2);
|
|
||||||
//
|
//
|
||||||
|
Standard_Real aTolR;
|
||||||
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
||||||
if (aGAS.GetType() == GeomAbs_SurfaceOfRevolution) {
|
if (pBAS->GetType() == GeomAbs_SurfaceOfRevolution) {
|
||||||
Standard_Real aTR;
|
Standard_Real aTR;
|
||||||
//
|
//
|
||||||
aTR=Precision::Confusion();//1.e-7;
|
aTR=Precision::Confusion();//1.e-7;
|
||||||
@ -664,12 +666,17 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
TolReached2d=aTolR;
|
TolReached2d=aTolR;
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2,
|
//
|
||||||
aC2D, aC2DA);
|
Handle(Geom2d_Curve) aC2DA;
|
||||||
|
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA);
|
||||||
//
|
//
|
||||||
aC2D=aC2DA;
|
aC2D=aC2DA;
|
||||||
//
|
//
|
||||||
// compute the appropriate tolerance for the edge
|
// compute the appropriate tolerance for the edge
|
||||||
|
Handle(Geom_Surface) aS = pBAS->Surface().Surface();
|
||||||
|
aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf()));
|
||||||
|
//
|
||||||
|
Standard_Real aT;
|
||||||
if (IntTools_Tools::ComputeTolerance
|
if (IntTools_Tools::ComputeTolerance
|
||||||
(aC3D, aC2D, aS, aT1, aT2, aTolR, aT)) {
|
(aC3D, aC2D, aS, aT1, aT2, aTolR, aT)) {
|
||||||
if (aTolR > TolReached2d) {
|
if (aTolR > TolReached2d) {
|
||||||
|
@ -45,9 +45,12 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! Compute P-Curve for the edge <aE> on the face <aF>
|
//! Compute P-Curve for the edge <aE> on the face <aF>.<br>
|
||||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||||
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
|
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
|
||||||
@ -55,26 +58,43 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//! Compute surface parameters <U,V> of the face <aF>
|
//! Compute surface parameters <U,V> of the face <aF>
|
||||||
//! for the point from the edge <aE> at parameter <aT>.
|
//! for the point from the edge <aE> at parameter <aT>.<br>
|
||||||
//! If <aE> has't pcurve on surface, algorithm tries to get it by
|
//! If <aE> has't pcurve on surface, algorithm tries to get it by
|
||||||
//! projection and can
|
//! projection and can
|
||||||
//! raise exception Standard_ConstructionError if projection algorithm fails
|
//! raise exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||||
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, Standard_Real& U, Standard_Real& V);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
const Standard_Real aT,
|
||||||
|
Standard_Real& U,
|
||||||
|
Standard_Real& V,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||||
//! If the P-Curve does not exist, build it using Make2D().
|
//! If the P-Curve does not exist, build it using Make2D().<br>
|
||||||
//! [aToler] - reached tolerance
|
//! [aToler] - reached tolerance
|
||||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
|
||||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
Handle(Geom2d_Curve)& aC,
|
||||||
|
Standard_Real& aToler,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
//! If the P-Curve does not exist, build it using Make2D().<br>
|
||||||
//! If the P-Curve does not exist, build it using Make2D().
|
//! [aFirst, aLast] - range of the P-Curve<br>
|
||||||
//! [aFirst, aLast] - range of the P-Curve
|
//! [aToler] - reached tolerance<br>
|
||||||
//! [aToler] - reached tolerance
|
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
|
||||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
Handle(Geom2d_Curve)& aC,
|
||||||
|
Standard_Real& aFirst,
|
||||||
|
Standard_Real& aLast,
|
||||||
|
Standard_Real& aToler,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||||
@ -91,18 +111,28 @@ public:
|
|||||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
||||||
|
|
||||||
|
|
||||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
//! Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>.<br>
|
||||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
|
||||||
|
const Handle(Geom_Curve)& theC3D,
|
||||||
|
const Handle(Geom2d_Curve)& theC2D,
|
||||||
|
Handle(Geom2d_Curve)& theC2DA,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
|
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .<br>
|
||||||
|
//! [aT1, aT2] - range to adjust<br>
|
||||||
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
|
||||||
|
const Standard_Real theFirst,
|
||||||
|
const Standard_Real theLast,
|
||||||
|
const Handle(Geom2d_Curve)& theC2D,
|
||||||
|
Handle(Geom2d_Curve)& theC2DA,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||||
//! [aT1, aT2] - range to adjust
|
//! [aT1, aT2] - range to adjust
|
||||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
Standard_EXPORT static void AdjustPCurveOnSurf (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
||||||
|
|
||||||
|
|
||||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
|
||||||
//! [aT1, aT2] - range to adjust
|
|
||||||
Standard_EXPORT static void AdjustPCurveOnFace (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
|
||||||
|
|
||||||
|
|
||||||
//! Compute intermediate value in between [aFirst, aLast] .
|
//! Compute intermediate value in between [aFirst, aLast] .
|
||||||
@ -123,24 +153,43 @@ public:
|
|||||||
Standard_EXPORT static void BuildPCurveForEdgesOnPlane (const BOPCol_ListOfShape& theLE, const TopoDS_Face& theF);
|
Standard_EXPORT static void BuildPCurveForEdgesOnPlane (const BOPCol_ListOfShape& theLE, const TopoDS_Face& theF);
|
||||||
|
|
||||||
|
|
||||||
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||||
//! [aFirst, aLast] - range of the P-Curve
|
//! [aFirst, aLast] - range of the P-Curve<br>
|
||||||
//! [aToler] - reached tolerance
|
//! [aToler] - reached tolerance<br>
|
||||||
//! Raises exception Standard_ConstructionError if algorithm fails
|
//! Raises exception Standard_ConstructionError if algorithm fails.<br>
|
||||||
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
Handle(Geom2d_Curve)& aC,
|
||||||
|
Standard_Real& aFirst,
|
||||||
|
Standard_Real& aLast,
|
||||||
|
Standard_Real& aToler,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
|
||||||
//! [aToler] - reached tolerance
|
//! [aToler] - reached tolerance<br>
|
||||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
|
||||||
|
const Handle(Geom_Curve)& C3D,
|
||||||
|
Handle(Geom2d_Curve)& aC,
|
||||||
|
Standard_Real& aToler,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
|
||||||
//! [aT1, aT2] - range to build
|
//! [aT1, aT2] - range to build<br>
|
||||||
//! [aToler] - reached tolerance
|
//! [aToler] - reached tolerance<br>
|
||||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, const Standard_Real aT1, const Standard_Real aT2, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
|
||||||
|
const Handle(Geom_Curve)& C3D,
|
||||||
|
const Standard_Real aT1,
|
||||||
|
const Standard_Real aT2,
|
||||||
|
Handle(Geom2d_Curve)& aC,
|
||||||
|
Standard_Real& aToler,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Make empty P-Curve <aC> of relevant to <PC> type
|
//! Make empty P-Curve <aC> of relevant to <PC> type
|
||||||
|
@ -231,14 +231,15 @@ void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF,
|
const TopoDS_Face& aF,
|
||||||
gp_Dir& aDNF)
|
gp_Dir& aDNF,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real aT, aT1, aT2;
|
Standard_Real aT, aT1, aT2;
|
||||||
|
|
||||||
BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2);
|
BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2);
|
||||||
aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2);
|
aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2);
|
||||||
|
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF, theContext);
|
||||||
|
|
||||||
if (aF.Orientation()==TopAbs_REVERSED){
|
if (aF.Orientation()==TopAbs_REVERSED){
|
||||||
aDNF.Reverse();
|
aDNF.Reverse();
|
||||||
@ -251,7 +252,8 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
|||||||
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
||||||
const TopoDS_Face& aF1,
|
const TopoDS_Face& aF1,
|
||||||
const Standard_Real aT,
|
const Standard_Real aT,
|
||||||
gp_Dir& aDNF1)
|
gp_Dir& aDNF1,
|
||||||
|
const Handle(IntTools_Context)& theContext)
|
||||||
{
|
{
|
||||||
Standard_Real U, V, aTolPC;
|
Standard_Real U, V, aTolPC;
|
||||||
gp_Pnt2d aP2D;
|
gp_Pnt2d aP2D;
|
||||||
@ -261,7 +263,7 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
|||||||
Handle(Geom_Surface) aS1=BRep_Tool::Surface(aF1);
|
Handle(Geom_Surface) aS1=BRep_Tool::Surface(aF1);
|
||||||
|
|
||||||
Handle(Geom2d_Curve)aC2D1;
|
Handle(Geom2d_Curve)aC2D1;
|
||||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF1, aC2D1, aTolPC);
|
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF1, aC2D1, aTolPC, theContext);
|
||||||
|
|
||||||
aC2D1->D0(aT, aP2D);
|
aC2D1->D0(aT, aP2D);
|
||||||
U=aP2D.X();
|
U=aP2D.X();
|
||||||
@ -511,7 +513,12 @@ void BOPTools_AlgoTools3D::PointNearEdge
|
|||||||
gp_Pnt aP;
|
gp_Pnt aP;
|
||||||
gp_Pnt2d aP2d;
|
gp_Pnt2d aP2d;
|
||||||
//
|
//
|
||||||
|
if (theContext.IsNull()) {
|
||||||
BRepTools::UVBounds(aF, aU1, aU2, aV1, aV2);
|
BRepTools::UVBounds(aF, aU1, aU2, aV1, aV2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
theContext->UVBounds(aF, aU1, aU2, aV1, aV2);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
dU=aU2-aU1;
|
dU=aU2-aU1;
|
||||||
dV=aV2-aV1;
|
dV=aV2-aV1;
|
||||||
@ -750,7 +757,12 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
|
|||||||
aFF.Orientation (TopAbs_FORWARD);
|
aFF.Orientation (TopAbs_FORWARD);
|
||||||
//
|
//
|
||||||
aS=BRep_Tool::Surface(aFF);
|
aS=BRep_Tool::Surface(aFF);
|
||||||
|
if (theContext.IsNull()) {
|
||||||
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
theContext->UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
|
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
|
@ -49,13 +49,22 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//! Computes normal to the face <aF> for the point on the edge <aE>
|
//! Computes normal to the face <aF> for the point on the edge <aE>
|
||||||
//! at parameter <aT>
|
//! at parameter <aT>.<br>
|
||||||
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Dir& aD);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
const Standard_Real aT,
|
||||||
|
gp_Dir& aD,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Computes normal to the face <aF> for the point on the edge <aE>
|
//! Computes normal to the face <aF> for the point on the edge <aE>
|
||||||
//! at arbitrary intermediate parameter
|
//! at arbitrary intermediate parameter.<br>
|
||||||
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, gp_Dir& aD);
|
//! <theContext> - storage for caching the geometrical tools
|
||||||
|
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
gp_Dir& aD,
|
||||||
|
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||||
|
|
||||||
|
|
||||||
//! Returns 1 if scalar product aNF1* aNF2>0.
|
//! Returns 1 if scalar product aNF1* aNF2>0.
|
||||||
|
@ -642,7 +642,7 @@
|
|||||||
aV2.Orientation(TopAbs_REVERSED);
|
aV2.Orientation(TopAbs_REVERSED);
|
||||||
//
|
//
|
||||||
BOPTools_AlgoTools::MakeSplitEdge(aE, aV1, aT1, aV2, aT2, aSp);
|
BOPTools_AlgoTools::MakeSplitEdge(aE, aV1, aT1, aV2, aT2, aSp);
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aSp, theF);
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aSp, theF, myContext);
|
||||||
//
|
//
|
||||||
aSI.SetShape(aSp);
|
aSI.SetShape(aSp);
|
||||||
//
|
//
|
||||||
|
@ -1608,7 +1608,9 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
|
|||||||
// Store Result
|
// Store Result
|
||||||
L1.Clear(); L2.Clear();
|
L1.Clear(); L2.Clear();
|
||||||
TopAbs_Orientation O1,O2;
|
TopAbs_Orientation O1,O2;
|
||||||
|
//
|
||||||
|
const Handle(IntTools_Context)& aContext = pPF->Context();
|
||||||
|
//
|
||||||
for (i = 0; i < aNb; i++) {
|
for (i = 0; i < aNb; i++) {
|
||||||
BOPDS_InterfFF& aFFi=aFFs(i);
|
BOPDS_InterfFF& aFFi=aFFs(i);
|
||||||
const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
|
const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
|
||||||
@ -1645,10 +1647,10 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
|
|||||||
Handle(Geom2d_Curve) aC2dNew;
|
Handle(Geom2d_Curve) aC2dNew;
|
||||||
|
|
||||||
if(aC3DE->IsPeriodic()) {
|
if(aC3DE->IsPeriodic()) {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF1, f, l, aC2d, aC2dNew);
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF1, f, l, aC2d, aC2dNew, aContext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF1, aC3DETrim, aC2d, aC2dNew);
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF1, aC3DETrim, aC2d, aC2dNew, aContext);
|
||||||
}
|
}
|
||||||
aC2d = aC2dNew;
|
aC2d = aC2dNew;
|
||||||
}
|
}
|
||||||
@ -1661,10 +1663,10 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
|
|||||||
Handle(Geom2d_Curve) aC2dNew;
|
Handle(Geom2d_Curve) aC2dNew;
|
||||||
|
|
||||||
if(aC3DE->IsPeriodic()) {
|
if(aC3DE->IsPeriodic()) {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF2, f, l, aC2d, aC2dNew);
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF2, f, l, aC2d, aC2dNew, aContext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF2, aC3DETrim, aC2d, aC2dNew);
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace(cpF2, aC3DETrim, aC2d, aC2dNew, aContext);
|
||||||
}
|
}
|
||||||
aC2d = aC2dNew;
|
aC2d = aC2dNew;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include <IntTools_Context.hxx>
|
#include <IntTools_Context.hxx>
|
||||||
#include <IntTools_CurveRangeLocalizeData.hxx>
|
#include <IntTools_CurveRangeLocalizeData.hxx>
|
||||||
#include <IntTools_CurveRangeSample.hxx>
|
#include <IntTools_CurveRangeSample.hxx>
|
||||||
#include <IntTools_EdgeFace.hxx>
|
#include <IntTools_CArray1OfReal.hxx>
|
||||||
#include <IntTools_ListIteratorOfListOfBox.hxx>
|
#include <IntTools_ListIteratorOfListOfBox.hxx>
|
||||||
#include <IntTools_ListIteratorOfListOfCurveRangeSample.hxx>
|
#include <IntTools_ListIteratorOfListOfCurveRangeSample.hxx>
|
||||||
#include <IntTools_ListIteratorOfListOfSurfaceRangeSample.hxx>
|
#include <IntTools_ListIteratorOfListOfSurfaceRangeSample.hxx>
|
||||||
@ -214,8 +214,12 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur
|
|||||||
void IntTools_BeanFaceIntersector::Init(const TopoDS_Edge& theEdge,
|
void IntTools_BeanFaceIntersector::Init(const TopoDS_Edge& theEdge,
|
||||||
const TopoDS_Face& theFace)
|
const TopoDS_Face& theFace)
|
||||||
{
|
{
|
||||||
|
if (myContext.IsNull()) {
|
||||||
|
myContext = new IntTools_Context;
|
||||||
|
}
|
||||||
|
//
|
||||||
myCurve.Initialize(theEdge);
|
myCurve.Initialize(theEdge);
|
||||||
mySurface.Initialize(theFace);
|
mySurface = myContext->SurfaceAdaptor(theFace);
|
||||||
myTrsfSurface = Handle(Geom_Surface)::DownCast(mySurface.Surface().Surface()->Transformed(mySurface.Trsf()));
|
myTrsfSurface = Handle(Geom_Surface)::DownCast(mySurface.Surface().Surface()->Transformed(mySurface.Trsf()));
|
||||||
myBeanTolerance = BRep_Tool::Tolerance(theEdge);
|
myBeanTolerance = BRep_Tool::Tolerance(theEdge);
|
||||||
myFaceTolerance = BRep_Tool::Tolerance(theFace);
|
myFaceTolerance = BRep_Tool::Tolerance(theFace);
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include <TopoDS_Solid.hxx>
|
#include <TopoDS_Solid.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(IntTools_Context,MMgt_TShared)
|
IMPLEMENT_STANDARD_RTTIEXT(IntTools_Context,Standard_Transient)
|
||||||
|
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -64,6 +64,7 @@ IntTools_Context::IntTools_Context()
|
|||||||
myHatcherMap(100, myAllocator),
|
myHatcherMap(100, myAllocator),
|
||||||
myProjSDataMap(100, myAllocator),
|
myProjSDataMap(100, myAllocator),
|
||||||
myBndBoxDataMap(100, myAllocator),
|
myBndBoxDataMap(100, myAllocator),
|
||||||
|
mySurfAdaptorMap(100, myAllocator),
|
||||||
myCreateFlag(0),
|
myCreateFlag(0),
|
||||||
myPOnSTolerance(1.e-12)
|
myPOnSTolerance(1.e-12)
|
||||||
{
|
{
|
||||||
@ -84,6 +85,7 @@ IntTools_Context::IntTools_Context
|
|||||||
myHatcherMap(100, myAllocator),
|
myHatcherMap(100, myAllocator),
|
||||||
myProjSDataMap(100, myAllocator),
|
myProjSDataMap(100, myAllocator),
|
||||||
myBndBoxDataMap(100, myAllocator),
|
myBndBoxDataMap(100, myAllocator),
|
||||||
|
mySurfAdaptorMap(100, myAllocator),
|
||||||
myCreateFlag(1),
|
myCreateFlag(1),
|
||||||
myPOnSTolerance(1.e-12)
|
myPOnSTolerance(1.e-12)
|
||||||
{
|
{
|
||||||
@ -171,6 +173,16 @@ IntTools_Context::~IntTools_Context()
|
|||||||
myAllocator->Free(anAdr);
|
myAllocator->Free(anAdr);
|
||||||
}
|
}
|
||||||
myBndBoxDataMap.Clear();
|
myBndBoxDataMap.Clear();
|
||||||
|
//
|
||||||
|
BRepAdaptor_Surface* pSurfAdaptor;
|
||||||
|
aIt.Initialize(mySurfAdaptorMap);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
anAdr=aIt.Value();
|
||||||
|
pSurfAdaptor=(BRepAdaptor_Surface*)anAdr;
|
||||||
|
(*pSurfAdaptor).~BRepAdaptor_Surface();
|
||||||
|
myAllocator->Free(anAdr);
|
||||||
|
}
|
||||||
|
mySurfAdaptorMap.Clear();
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BndBox
|
//function : BndBox
|
||||||
@ -265,15 +277,8 @@ GeomAPI_ProjectPointOnSurf& IntTools_Context::ProjPS(const TopoDS_Face& aF)
|
|||||||
|
|
||||||
if (!myProjPSMap.IsBound(aF)) {
|
if (!myProjPSMap.IsBound(aF)) {
|
||||||
Standard_Real Umin, Usup, Vmin, Vsup;
|
Standard_Real Umin, Usup, Vmin, Vsup;
|
||||||
BRepAdaptor_Surface aBAS;
|
UVBounds(aF, Umin, Usup, Vmin, Vsup);
|
||||||
//
|
|
||||||
const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF);
|
const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF);
|
||||||
aBAS.Initialize (aF, Standard_True);
|
|
||||||
//
|
|
||||||
Umin=aBAS.FirstUParameter();
|
|
||||||
Usup=aBAS.LastUParameter ();
|
|
||||||
Vmin=aBAS.FirstVParameter();
|
|
||||||
Vsup=aBAS.LastVParameter ();
|
|
||||||
//
|
//
|
||||||
pProjPS=(GeomAPI_ProjectPointOnSurf*)myAllocator->Allocate(sizeof(GeomAPI_ProjectPointOnSurf));
|
pProjPS=(GeomAPI_ProjectPointOnSurf*)myAllocator->Allocate(sizeof(GeomAPI_ProjectPointOnSurf));
|
||||||
new (pProjPS) GeomAPI_ProjectPointOnSurf();
|
new (pProjPS) GeomAPI_ProjectPointOnSurf();
|
||||||
@ -376,6 +381,32 @@ BRepClass3d_SolidClassifier& IntTools_Context::SolidClassifier
|
|||||||
return *pSC;
|
return *pSC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SurfaceAdaptor
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
BRepAdaptor_Surface& IntTools_Context::SurfaceAdaptor
|
||||||
|
(const TopoDS_Face& theFace)
|
||||||
|
{
|
||||||
|
Standard_Address anAdr;
|
||||||
|
BRepAdaptor_Surface* pBAS;
|
||||||
|
|
||||||
|
if (!mySurfAdaptorMap.IsBound(theFace)) {
|
||||||
|
//
|
||||||
|
pBAS=(BRepAdaptor_Surface*)myAllocator->Allocate(sizeof(BRepAdaptor_Surface));
|
||||||
|
new (pBAS) BRepAdaptor_Surface(theFace, Standard_True);
|
||||||
|
//
|
||||||
|
anAdr=(Standard_Address)pBAS;
|
||||||
|
mySurfAdaptorMap.Bind(theFace, anAdr);
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
anAdr=mySurfAdaptorMap.Find(theFace);
|
||||||
|
pBAS =(BRepAdaptor_Surface*)anAdr;
|
||||||
|
}
|
||||||
|
return *pBAS;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Hatcher
|
//function : Hatcher
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1042,3 +1073,20 @@ void IntTools_Context::clearCachedPOnSProjectors()
|
|||||||
}
|
}
|
||||||
myProjPSMap.Clear();
|
myProjPSMap.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UVBounds
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void IntTools_Context::UVBounds(const TopoDS_Face& theFace,
|
||||||
|
Standard_Real& UMin,
|
||||||
|
Standard_Real& UMax,
|
||||||
|
Standard_Real& VMin,
|
||||||
|
Standard_Real& VMax)
|
||||||
|
{
|
||||||
|
const BRepAdaptor_Surface& aBAS = SurfaceAdaptor(theFace);
|
||||||
|
UMin = aBAS.FirstUParameter();
|
||||||
|
UMax = aBAS.LastUParameter ();
|
||||||
|
VMin = aBAS.FirstVParameter();
|
||||||
|
VMax = aBAS.LastVParameter ();
|
||||||
|
}
|
@ -27,6 +27,7 @@
|
|||||||
#include <MMgt_TShared.hxx>
|
#include <MMgt_TShared.hxx>
|
||||||
#include <TopAbs_State.hxx>
|
#include <TopAbs_State.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
class IntTools_FClass2d;
|
class IntTools_FClass2d;
|
||||||
class TopoDS_Face;
|
class TopoDS_Face;
|
||||||
class GeomAPI_ProjectPointOnSurf;
|
class GeomAPI_ProjectPointOnSurf;
|
||||||
@ -45,17 +46,12 @@ class Bnd_Box;
|
|||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
class IntTools_Context;
|
|
||||||
DEFINE_STANDARD_HANDLE(IntTools_Context, MMgt_TShared)
|
|
||||||
|
|
||||||
|
|
||||||
//! The intersection Context contains geometrical
|
//! The intersection Context contains geometrical
|
||||||
//! and topological toolkit (classifiers, projectors, etc).
|
//! and topological toolkit (classifiers, projectors, etc).
|
||||||
//! The intersection Context is for caching the tools
|
//! The intersection Context is for caching the tools
|
||||||
//! to increase the performance.
|
//! to increase the performance.
|
||||||
class IntTools_Context : public MMgt_TShared
|
class IntTools_Context : public Standard_Transient
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
@ -99,6 +95,15 @@ Standard_EXPORT virtual ~IntTools_Context();
|
|||||||
//! for given face
|
//! for given face
|
||||||
Standard_EXPORT Geom2dHatch_Hatcher& Hatcher (const TopoDS_Face& aF);
|
Standard_EXPORT Geom2dHatch_Hatcher& Hatcher (const TopoDS_Face& aF);
|
||||||
|
|
||||||
|
//! Returns a reference to surface adaptor for given face
|
||||||
|
Standard_EXPORT BRepAdaptor_Surface& SurfaceAdaptor (const TopoDS_Face& theFace);
|
||||||
|
|
||||||
|
//! Computes the boundaries of the face using surface adaptor
|
||||||
|
Standard_EXPORT void UVBounds (const TopoDS_Face& theFace,
|
||||||
|
Standard_Real& UMin,
|
||||||
|
Standard_Real& UMax,
|
||||||
|
Standard_Real& VMin,
|
||||||
|
Standard_Real& VMax);
|
||||||
|
|
||||||
//! Computes parameter of the Point theP on
|
//! Computes parameter of the Point theP on
|
||||||
//! the edge aE.
|
//! the edge aE.
|
||||||
@ -230,7 +235,7 @@ Standard_EXPORT virtual ~IntTools_Context();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(IntTools_Context,MMgt_TShared)
|
DEFINE_STANDARD_RTTIEXT(IntTools_Context,Standard_Transient)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -244,6 +249,7 @@ protected:
|
|||||||
BOPCol_DataMapOfShapeAddress myHatcherMap;
|
BOPCol_DataMapOfShapeAddress myHatcherMap;
|
||||||
BOPCol_DataMapOfShapeAddress myProjSDataMap;
|
BOPCol_DataMapOfShapeAddress myProjSDataMap;
|
||||||
BOPCol_DataMapOfShapeAddress myBndBoxDataMap;
|
BOPCol_DataMapOfShapeAddress myBndBoxDataMap;
|
||||||
|
BOPCol_DataMapOfShapeAddress mySurfAdaptorMap;
|
||||||
Standard_Integer myCreateFlag;
|
Standard_Integer myCreateFlag;
|
||||||
Standard_Real myPOnSTolerance;
|
Standard_Real myPOnSTolerance;
|
||||||
|
|
||||||
@ -256,4 +262,6 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DEFINE_STANDARD_HANDLE(IntTools_Context, Standard_Transient)
|
||||||
|
|
||||||
#endif // _IntTools_Context_HeaderFile
|
#endif // _IntTools_Context_HeaderFile
|
||||||
|
@ -39,13 +39,12 @@
|
|||||||
#include <IntCurveSurface_HInter.hxx>
|
#include <IntCurveSurface_HInter.hxx>
|
||||||
#include <IntCurveSurface_IntersectionPoint.hxx>
|
#include <IntCurveSurface_IntersectionPoint.hxx>
|
||||||
#include <IntTools.hxx>
|
#include <IntTools.hxx>
|
||||||
#include <IntTools_Array1OfRange.hxx>
|
|
||||||
#include <IntTools_BeanFaceIntersector.hxx>
|
#include <IntTools_BeanFaceIntersector.hxx>
|
||||||
#include <IntTools_CArray1OfInteger.hxx>
|
#include <IntTools_CArray1OfInteger.hxx>
|
||||||
#include <IntTools_CArray1OfReal.hxx>
|
|
||||||
#include <IntTools_CommonPrt.hxx>
|
#include <IntTools_CommonPrt.hxx>
|
||||||
#include <IntTools_Context.hxx>
|
#include <IntTools_Context.hxx>
|
||||||
#include <IntTools_EdgeFace.hxx>
|
#include <IntTools_EdgeFace.hxx>
|
||||||
|
#include <IntTools_FClass2d.hxx>
|
||||||
#include <IntTools_Range.hxx>
|
#include <IntTools_Range.hxx>
|
||||||
#include <IntTools_Root.hxx>
|
#include <IntTools_Root.hxx>
|
||||||
#include <IntTools_Tools.hxx>
|
#include <IntTools_Tools.hxx>
|
||||||
@ -61,10 +60,6 @@ static
|
|||||||
Standard_Boolean IsRadius (const BRepAdaptor_Curve& aCurve ,
|
Standard_Boolean IsRadius (const BRepAdaptor_Curve& aCurve ,
|
||||||
const BRepAdaptor_Surface& aSurface,
|
const BRepAdaptor_Surface& aSurface,
|
||||||
const Standard_Real aCriteria);
|
const Standard_Real aCriteria);
|
||||||
static
|
|
||||||
Standard_Integer AdaptiveDiscret (const Standard_Integer iDiscret,
|
|
||||||
const BRepAdaptor_Curve& aCurve ,
|
|
||||||
const BRepAdaptor_Surface& aSurface);
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntTools_EdgeFace::IntTools_EdgeFace
|
//function : IntTools_EdgeFace::IntTools_EdgeFace
|
||||||
@ -303,170 +298,7 @@ void IntTools_EdgeFace::CheckData()
|
|||||||
myErrorStatus=3;
|
myErrorStatus=3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
|
||||||
//function : Prepare
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void IntTools_EdgeFace::Prepare()
|
|
||||||
{
|
|
||||||
Standard_Integer pri;
|
|
||||||
Standard_Real aTmin, aTmax;
|
|
||||||
IntTools_CArray1OfReal aPars;
|
|
||||||
|
|
||||||
//
|
|
||||||
// 1.Prepare Curve's data and Surface's data
|
|
||||||
myC.Initialize(myEdge);
|
|
||||||
GeomAbs_CurveType aCurveType;
|
|
||||||
aCurveType=myC.GetType();
|
|
||||||
//
|
|
||||||
// 2.Prepare myCriteria
|
|
||||||
Standard_Real aFuzz = myFuzzyValue / 2.;
|
|
||||||
Standard_Real aTolF = BRep_Tool::Tolerance(myFace) + aFuzz;
|
|
||||||
Standard_Real aTolE = BRep_Tool::Tolerance(myEdge) + aFuzz;
|
|
||||||
if (aCurveType == GeomAbs_BSplineCurve ||
|
|
||||||
aCurveType == GeomAbs_BezierCurve) {
|
|
||||||
myCriteria = 1.5*aTolE + aTolF;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
myCriteria = aTolE + aTolF;
|
|
||||||
}
|
|
||||||
// 2.a myTmin, myTmax
|
|
||||||
aTmin=myRange.First();
|
|
||||||
aTmax=myRange.Last();
|
|
||||||
// 2.b myFClass2d
|
|
||||||
myS.Initialize (myFace,Standard_True);
|
|
||||||
myFClass2d.Init(myFace, 1.e-6);
|
|
||||||
//
|
|
||||||
// 2.c Prepare adaptive myDiscret
|
|
||||||
myDiscret=AdaptiveDiscret(myDiscret, myC, myS);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// 3.Prepare myPars
|
|
||||||
pri = IntTools::PrepareArgs(myC, aTmax, aTmin,
|
|
||||||
myDiscret, myDeflection, aPars);
|
|
||||||
if (pri) {
|
|
||||||
myErrorStatus=6;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 4.
|
|
||||||
//ProjectableRanges
|
|
||||||
Standard_Integer i, iProj, aNb, aNbProj, ind0, ind1;
|
|
||||||
Standard_Real t0, t1, tRoot;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Table of Projection's function values
|
|
||||||
aNb=aPars.Length();
|
|
||||||
IntTools_CArray1OfInteger anArrProjectability;
|
|
||||||
anArrProjectability.Resize(aNb);
|
|
||||||
|
|
||||||
for (iProj=0, i=0; i<aNb; i++) {
|
|
||||||
t0=aPars(i);
|
|
||||||
aNbProj=IsProjectable (t0);
|
|
||||||
|
|
||||||
anArrProjectability(i)=0;
|
|
||||||
if (aNbProj) {
|
|
||||||
anArrProjectability(i)=1;
|
|
||||||
iProj++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Checking
|
|
||||||
if (!iProj ) {
|
|
||||||
myErrorStatus=7;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Projectable Ranges
|
|
||||||
IntTools_Range aRange;
|
|
||||||
|
|
||||||
ind0=anArrProjectability(0);
|
|
||||||
if (ind0) {
|
|
||||||
t0=aPars(0);
|
|
||||||
aRange.SetFirst(t0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i=1; i<aNb; i++) {
|
|
||||||
ind1=anArrProjectability(i);
|
|
||||||
t0=aPars(i-1);
|
|
||||||
t1=aPars(i);
|
|
||||||
|
|
||||||
if (i==(aNb-1)) {
|
|
||||||
if (ind1 && ind0) {
|
|
||||||
aRange.SetLast(t1);
|
|
||||||
myProjectableRanges.Append(aRange);
|
|
||||||
}
|
|
||||||
if (ind1 && !ind0) {
|
|
||||||
FindProjectableRoot(t0, t1, ind0, ind1, tRoot);
|
|
||||||
aRange.SetFirst(tRoot);
|
|
||||||
aRange.SetLast(t1);
|
|
||||||
myProjectableRanges.Append(aRange);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (ind0 && !ind1) {
|
|
||||||
FindProjectableRoot(t0, t1, ind0, ind1, tRoot);
|
|
||||||
aRange.SetLast(tRoot);
|
|
||||||
myProjectableRanges.Append(aRange);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ind0 != ind1) {
|
|
||||||
FindProjectableRoot(t0, t1, ind0, ind1, tRoot);
|
|
||||||
|
|
||||||
if (ind0 && !ind1) {
|
|
||||||
aRange.SetLast(tRoot);
|
|
||||||
myProjectableRanges.Append(aRange);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
aRange.SetFirst(tRoot);
|
|
||||||
}
|
|
||||||
} // if (ind0 != ind1)
|
|
||||||
ind0=ind1;
|
|
||||||
} // for(i=1; i<aNb; i++) {
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : FindProjectableRoot
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void IntTools_EdgeFace::FindProjectableRoot (const Standard_Real tt1,
|
|
||||||
const Standard_Real tt2,
|
|
||||||
const Standard_Integer ff1,
|
|
||||||
const Standard_Integer /*ff2*/,
|
|
||||||
Standard_Real& tRoot)
|
|
||||||
{
|
|
||||||
Standard_Real tm, t1, t2, aEpsT;
|
|
||||||
Standard_Integer anIsProj1, anIsProjm;
|
|
||||||
aEpsT = 0.5 * myEpsT;
|
|
||||||
|
|
||||||
// Root is inside [tt1, tt2]
|
|
||||||
t1 = tt1;
|
|
||||||
t2 = tt2;
|
|
||||||
anIsProj1 = ff1;
|
|
||||||
|
|
||||||
for(;;)
|
|
||||||
{
|
|
||||||
if (fabs(t1 - t2) < aEpsT)
|
|
||||||
{
|
|
||||||
tRoot = (anIsProj1) ? t1 : t2;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
tm = 0.5 * (t1 + t2);
|
|
||||||
anIsProjm = IsProjectable(tm);
|
|
||||||
|
|
||||||
if (anIsProjm != anIsProj1)
|
|
||||||
{
|
|
||||||
t2 = tm;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
t1 = tm;
|
|
||||||
anIsProj1 = anIsProjm;
|
|
||||||
}
|
|
||||||
} // for(;;)
|
|
||||||
}
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsProjectable
|
//function : IsProjectable
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -651,6 +483,11 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch
|
|||||||
(const IntTools_CommonPrt& aCP,
|
(const IntTools_CommonPrt& aCP,
|
||||||
Standard_Real& aTx)
|
Standard_Real& aTx)
|
||||||
{
|
{
|
||||||
|
if (myC.GetType() == GeomAbs_Line &&
|
||||||
|
myS.GetType() == GeomAbs_Plane) {
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
//
|
||||||
Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2;
|
Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2;
|
||||||
Standard_Boolean theflag=Standard_False;
|
Standard_Boolean theflag=Standard_False;
|
||||||
Standard_Integer aNbExt, iLower;
|
Standard_Integer aNbExt, iLower;
|
||||||
@ -816,12 +653,8 @@ void IntTools_EdgeFace::Perform()
|
|||||||
myCriteria = aTolE + aTolF;
|
myCriteria = aTolE + aTolF;
|
||||||
}
|
}
|
||||||
|
|
||||||
myS.Initialize (myFace,Standard_True);
|
myS = myContext->SurfaceAdaptor(myFace);
|
||||||
|
|
||||||
if(myContext.IsNull()) {
|
|
||||||
myFClass2d.Init(myFace, 1.e-6);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (myQuickCoincidenceCheck) {
|
if (myQuickCoincidenceCheck) {
|
||||||
if (IsCoincident()) {
|
if (IsCoincident()) {
|
||||||
aCommonPrt.SetType(TopAbs_EDGE);
|
aCommonPrt.SetType(TopAbs_EDGE);
|
||||||
|
@ -28,8 +28,6 @@
|
|||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <IntTools_SequenceOfRanges.hxx>
|
#include <IntTools_SequenceOfRanges.hxx>
|
||||||
#include <IntTools_FClass2d.hxx>
|
|
||||||
#include <IntTools_CArray1OfReal.hxx>
|
|
||||||
#include <IntTools_SequenceOfCommonPrts.hxx>
|
#include <IntTools_SequenceOfCommonPrts.hxx>
|
||||||
#include <IntTools_Range.hxx>
|
#include <IntTools_Range.hxx>
|
||||||
class IntTools_Context;
|
class IntTools_Context;
|
||||||
@ -38,7 +36,6 @@ class TopoDS_Face;
|
|||||||
class IntTools_Range;
|
class IntTools_Range;
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
class BRepAdaptor_Surface;
|
class BRepAdaptor_Surface;
|
||||||
class IntTools_CArray1OfReal;
|
|
||||||
class IntTools_CommonPrt;
|
class IntTools_CommonPrt;
|
||||||
|
|
||||||
|
|
||||||
@ -151,12 +148,8 @@ protected:
|
|||||||
Standard_EXPORT static Standard_Boolean IsEqDistance (const gp_Pnt& aP, const BRepAdaptor_Surface& aS, const Standard_Real aT, Standard_Real& aD);
|
Standard_EXPORT static Standard_Boolean IsEqDistance (const gp_Pnt& aP, const BRepAdaptor_Surface& aS, const Standard_Real aT, Standard_Real& aD);
|
||||||
Standard_EXPORT void CheckData();
|
Standard_EXPORT void CheckData();
|
||||||
|
|
||||||
Standard_EXPORT void Prepare();
|
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean IsProjectable (const Standard_Real t) const;
|
Standard_EXPORT Standard_Boolean IsProjectable (const Standard_Real t) const;
|
||||||
|
|
||||||
Standard_EXPORT void FindProjectableRoot (const Standard_Real t1, const Standard_Real t2, const Standard_Integer f1, const Standard_Integer f2, Standard_Real& tRoot);
|
|
||||||
|
|
||||||
Standard_EXPORT Standard_Real DistanceFunction (const Standard_Real t);
|
Standard_EXPORT Standard_Real DistanceFunction (const Standard_Real t);
|
||||||
|
|
||||||
Standard_EXPORT Standard_Integer MakeType (IntTools_CommonPrt& aCP);
|
Standard_EXPORT Standard_Integer MakeType (IntTools_CommonPrt& aCP);
|
||||||
@ -186,8 +179,6 @@ private:
|
|||||||
Standard_Boolean myIsDone;
|
Standard_Boolean myIsDone;
|
||||||
Standard_Integer myErrorStatus;
|
Standard_Integer myErrorStatus;
|
||||||
Handle(IntTools_Context) myContext;
|
Handle(IntTools_Context) myContext;
|
||||||
IntTools_SequenceOfRanges myProjectableRanges;
|
|
||||||
IntTools_FClass2d myFClass2d;
|
|
||||||
IntTools_SequenceOfCommonPrts mySeqOfCommonPrts;
|
IntTools_SequenceOfCommonPrts mySeqOfCommonPrts;
|
||||||
IntTools_Range myRange;
|
IntTools_Range myRange;
|
||||||
|
|
||||||
|
@ -134,7 +134,8 @@ static
|
|||||||
//
|
//
|
||||||
static
|
static
|
||||||
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
||||||
const TopoDS_Face& aFace);
|
const TopoDS_Face& aFace,
|
||||||
|
const Handle(IntTools_Context)& theCtx);
|
||||||
|
|
||||||
static
|
static
|
||||||
Standard_Real MaxDistance(const Handle(Geom_Curve)& theC,
|
Standard_Real MaxDistance(const Handle(Geom_Curve)& theC,
|
||||||
@ -313,26 +314,25 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
|
static Standard_Boolean isTreatAnalityc(const BRepAdaptor_Surface& theBAS1,
|
||||||
const TopoDS_Face& theF2,
|
const BRepAdaptor_Surface& theBAS2,
|
||||||
const Standard_Real theTol)
|
const Standard_Real theTol)
|
||||||
{
|
{
|
||||||
const Standard_Real Tolang = 1.e-8;
|
const Standard_Real Tolang = 1.e-8;
|
||||||
Standard_Real aHigh = 0.0;
|
Standard_Real aHigh = 0.0;
|
||||||
|
|
||||||
const BRepAdaptor_Surface aBAS1(theF1), aBAS2(theF2);
|
const GeomAbs_SurfaceType aType1=theBAS1.GetType();
|
||||||
const GeomAbs_SurfaceType aType1=aBAS1.GetType();
|
const GeomAbs_SurfaceType aType2=theBAS2.GetType();
|
||||||
const GeomAbs_SurfaceType aType2=aBAS2.GetType();
|
|
||||||
|
|
||||||
gp_Pln aS1;
|
gp_Pln aS1;
|
||||||
gp_Cylinder aS2;
|
gp_Cylinder aS2;
|
||||||
if(aType1 == GeomAbs_Plane)
|
if(aType1 == GeomAbs_Plane)
|
||||||
{
|
{
|
||||||
aS1=aBAS1.Plane();
|
aS1=theBAS1.Plane();
|
||||||
}
|
}
|
||||||
else if(aType2 == GeomAbs_Plane)
|
else if(aType2 == GeomAbs_Plane)
|
||||||
{
|
{
|
||||||
aS1=aBAS2.Plane();
|
aS1=theBAS2.Plane();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -341,9 +341,9 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
|
|||||||
|
|
||||||
if(aType1 == GeomAbs_Cylinder)
|
if(aType1 == GeomAbs_Cylinder)
|
||||||
{
|
{
|
||||||
aS2=aBAS1.Cylinder();
|
aS2=theBAS1.Cylinder();
|
||||||
const Standard_Real VMin = aBAS1.FirstVParameter();
|
const Standard_Real VMin = theBAS1.FirstVParameter();
|
||||||
const Standard_Real VMax = aBAS1.LastVParameter();
|
const Standard_Real VMax = theBAS1.LastVParameter();
|
||||||
|
|
||||||
if( Precision::IsNegativeInfinite(VMin) ||
|
if( Precision::IsNegativeInfinite(VMin) ||
|
||||||
Precision::IsPositiveInfinite(VMax))
|
Precision::IsPositiveInfinite(VMax))
|
||||||
@ -353,10 +353,10 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
|
|||||||
}
|
}
|
||||||
else if(aType2 == GeomAbs_Cylinder)
|
else if(aType2 == GeomAbs_Cylinder)
|
||||||
{
|
{
|
||||||
aS2=aBAS2.Cylinder();
|
aS2=theBAS2.Cylinder();
|
||||||
|
|
||||||
const Standard_Real VMin = aBAS2.FirstVParameter();
|
const Standard_Real VMin = theBAS2.FirstVParameter();
|
||||||
const Standard_Real VMax = aBAS2.LastVParameter();
|
const Standard_Real VMax = theBAS2.LastVParameter();
|
||||||
|
|
||||||
if( Precision::IsNegativeInfinite(VMin) ||
|
if( Precision::IsNegativeInfinite(VMin) ||
|
||||||
Precision::IsPositiveInfinite(VMax))
|
Precision::IsPositiveInfinite(VMax))
|
||||||
@ -407,8 +407,8 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
myFace1=aF1;
|
myFace1=aF1;
|
||||||
myFace2=aF2;
|
myFace2=aF2;
|
||||||
|
|
||||||
const BRepAdaptor_Surface aBAS1(myFace1, Standard_False);
|
const BRepAdaptor_Surface& aBAS1 = myContext->SurfaceAdaptor(myFace1);
|
||||||
const BRepAdaptor_Surface aBAS2(myFace2, Standard_False);
|
const BRepAdaptor_Surface& aBAS2 = myContext->SurfaceAdaptor(myFace2);
|
||||||
GeomAbs_SurfaceType aType1=aBAS1.GetType();
|
GeomAbs_SurfaceType aType1=aBAS1.GetType();
|
||||||
GeomAbs_SurfaceType aType2=aBAS2.GetType();
|
GeomAbs_SurfaceType aType2=aBAS2.GetType();
|
||||||
|
|
||||||
@ -462,11 +462,11 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
if(aType1==GeomAbs_Plane && aType2==GeomAbs_Plane) {
|
if(aType1==GeomAbs_Plane && aType2==GeomAbs_Plane) {
|
||||||
Standard_Real umin, umax, vmin, vmax;
|
Standard_Real umin, umax, vmin, vmax;
|
||||||
//
|
//
|
||||||
BRepTools::UVBounds(myFace1, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace1, umin, umax, vmin, vmax);
|
||||||
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
||||||
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
||||||
//
|
//
|
||||||
BRepTools::UVBounds(myFace2, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace2, umin, umax, vmin, vmax);
|
||||||
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
||||||
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
||||||
//
|
//
|
||||||
@ -514,11 +514,11 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
{
|
{
|
||||||
Standard_Real umin, umax, vmin, vmax;
|
Standard_Real umin, umax, vmin, vmax;
|
||||||
// F1
|
// F1
|
||||||
BRepTools::UVBounds(myFace1, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace1, umin, umax, vmin, vmax);
|
||||||
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
||||||
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
||||||
// F2
|
// F2
|
||||||
BRepTools::UVBounds(myFace2, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace2, umin, umax, vmin, vmax);
|
||||||
CorrectSurfaceBoundaries(myFace2, myTol * 2., umin, umax, vmin, vmax);
|
CorrectSurfaceBoundaries(myFace2, myTol * 2., umin, umax, vmin, vmax);
|
||||||
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
||||||
}
|
}
|
||||||
@ -526,21 +526,21 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
{
|
{
|
||||||
Standard_Real umin, umax, vmin, vmax;
|
Standard_Real umin, umax, vmin, vmax;
|
||||||
//F1
|
//F1
|
||||||
BRepTools::UVBounds(myFace1, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace1, umin, umax, vmin, vmax);
|
||||||
CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax);
|
CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax);
|
||||||
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
||||||
// F2
|
// F2
|
||||||
BRepTools::UVBounds(myFace2, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace2, umin, umax, vmin, vmax);
|
||||||
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
|
||||||
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Standard_Real umin, umax, vmin, vmax;
|
Standard_Real umin, umax, vmin, vmax;
|
||||||
BRepTools::UVBounds(myFace1, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace1, umin, umax, vmin, vmax);
|
||||||
CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax);
|
CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax);
|
||||||
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
|
||||||
BRepTools::UVBounds(myFace2, umin, umax, vmin, vmax);
|
myContext->UVBounds(myFace2, umin, umax, vmin, vmax);
|
||||||
CorrectSurfaceBoundaries(myFace2, myTol * 2., umin, umax, vmin, vmax);
|
CorrectSurfaceBoundaries(myFace2, myTol * 2., umin, umax, vmin, vmax);
|
||||||
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
|
||||||
}
|
}
|
||||||
@ -626,7 +626,7 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const Standard_Boolean isGeomInt = isTreatAnalityc(aF1, aF2, myTol);
|
const Standard_Boolean isGeomInt = isTreatAnalityc(aBAS1, aBAS2, myTol);
|
||||||
myIntersector.Perform(myHS1, dom1, myHS2, dom2, TolArc, TolTang,
|
myIntersector.Perform(myHS1, dom1, myHS2, dom2, TolArc, TolTang,
|
||||||
myListOfPnts, RestrictLine, isGeomInt);
|
myListOfPnts, RestrictLine, isGeomInt);
|
||||||
|
|
||||||
@ -1648,7 +1648,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ###########################################
|
// ###########################################
|
||||||
bPCurvesOk = CheckPCurve(BS1, myFace2);
|
bPCurvesOk = CheckPCurve(BS1, myFace2, myContext);
|
||||||
aCurve.SetSecondCurve2d(BS1);
|
aCurve.SetSecondCurve2d(BS1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1674,7 +1674,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ###########################################
|
// ###########################################
|
||||||
bPCurvesOk = bPCurvesOk && CheckPCurve(BS2, myFace1);
|
bPCurvesOk = bPCurvesOk && CheckPCurve(BS2, myFace1, myContext);
|
||||||
aCurve.SetFirstCurve2d(BS2);
|
aCurve.SetFirstCurve2d(BS2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1693,12 +1693,12 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
|
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
H1 = GeomInt_IntSS::MakeBSpline2d(WL, ifprm, ilprm, Standard_True);
|
H1 = GeomInt_IntSS::MakeBSpline2d(WL, ifprm, ilprm, Standard_True);
|
||||||
bPCurvesOk = CheckPCurve(H1, myFace1);
|
bPCurvesOk = CheckPCurve(H1, myFace1, myContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
H2 = GeomInt_IntSS::MakeBSpline2d(WL, ifprm, ilprm, Standard_False);
|
H2 = GeomInt_IntSS::MakeBSpline2d(WL, ifprm, ilprm, Standard_False);
|
||||||
bPCurvesOk = bPCurvesOk && CheckPCurve(H2, myFace2);
|
bPCurvesOk = bPCurvesOk && CheckPCurve(H2, myFace2, myContext);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//if pcurves created without approximation are out of the
|
//if pcurves created without approximation are out of the
|
||||||
@ -1753,7 +1753,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
newCheck.FixTangent(Standard_True,Standard_True);
|
newCheck.FixTangent(Standard_True,Standard_True);
|
||||||
//
|
//
|
||||||
if (!reApprox) {
|
if (!reApprox) {
|
||||||
bIsValid1=CheckPCurve(BS1, myFace1);
|
bIsValid1=CheckPCurve(BS1, myFace1, myContext);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aCurve.SetFirstCurve2d(BS1);
|
aCurve.SetFirstCurve2d(BS1);
|
||||||
@ -1785,7 +1785,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
|||||||
newCheck.FixTangent(Standard_True,Standard_True);
|
newCheck.FixTangent(Standard_True,Standard_True);
|
||||||
//
|
//
|
||||||
if (!reApprox) {
|
if (!reApprox) {
|
||||||
bIsValid2=CheckPCurve(BS2, myFace2);
|
bIsValid2=CheckPCurve(BS2, myFace2, myContext);
|
||||||
}
|
}
|
||||||
aCurve.SetSecondCurve2d(BS2);
|
aCurve.SetSecondCurve2d(BS2);
|
||||||
}
|
}
|
||||||
@ -2962,13 +2962,14 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC,
|
|||||||
//purpose : Checks if points of the pcurve are out of the face bounds.
|
//purpose : Checks if points of the pcurve are out of the face bounds.
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
||||||
const TopoDS_Face& aFace)
|
const TopoDS_Face& aFace,
|
||||||
|
const Handle(IntTools_Context)& theCtx)
|
||||||
{
|
{
|
||||||
const Standard_Integer NPoints = 23;
|
const Standard_Integer NPoints = 23;
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
Standard_Real umin,umax,vmin,vmax;
|
Standard_Real umin,umax,vmin,vmax;
|
||||||
|
|
||||||
BRepTools::UVBounds(aFace, umin, umax, vmin, vmax);
|
theCtx->UVBounds(aFace, umin, umax, vmin, vmax);
|
||||||
Standard_Real tolU = Max ((umax-umin)*0.01, Precision::Confusion());
|
Standard_Real tolU = Max ((umax-umin)*0.01, Precision::Confusion());
|
||||||
Standard_Real tolV = Max ((vmax-vmin)*0.01, Precision::Confusion());
|
Standard_Real tolV = Max ((vmax-vmin)*0.01, Precision::Confusion());
|
||||||
Standard_Real fp = aPC->FirstParameter();
|
Standard_Real fp = aPC->FirstParameter();
|
||||||
|
@ -554,6 +554,8 @@ Standard_Boolean QANewModTopOpe_Tools::BoolOpe(const TopoDS_Shape& theFace1,
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Handle(IntTools_Context)& aContext = aDSFiller.Context();
|
||||||
|
//
|
||||||
IsCommonFound = Standard_True;
|
IsCommonFound = Standard_True;
|
||||||
TopExp::MapShapes(aCommon.Shape(), TopAbs_VERTEX, aMapV);
|
TopExp::MapShapes(aCommon.Shape(), TopAbs_VERTEX, aMapV);
|
||||||
// fill edge history.begin
|
// fill edge history.begin
|
||||||
@ -586,8 +588,8 @@ Standard_Boolean QANewModTopOpe_Tools::BoolOpe(const TopoDS_Shape& theFace1,
|
|||||||
Standard_Integer nE = aLSE.First();
|
Standard_Integer nE = aLSE.First();
|
||||||
const TopoDS_Edge& aSpE = *(TopoDS_Edge*)(&pDS->Shape(nE));
|
const TopoDS_Edge& aSpE = *(TopoDS_Edge*)(&pDS->Shape(nE));
|
||||||
|
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aSpE, aF1, aDNF1);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aSpE, aF1, aDNF1, aContext);
|
||||||
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aSpE, aF2, aDNF2);
|
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aSpE, aF2, aDNF2, aContext);
|
||||||
iSenseFlag=BOPTools_AlgoTools3D::SenseFlag (aDNF1, aDNF2);
|
iSenseFlag=BOPTools_AlgoTools3D::SenseFlag (aDNF1, aDNF2);
|
||||||
|
|
||||||
if(iSenseFlag == 1) {
|
if(iSenseFlag == 1) {
|
||||||
|
25
tests/bugs/modalg_6/bug28165_1
Normal file
25
tests/bugs/modalg_6/bug28165_1
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28165"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# Improve performance of Boolean Operations
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28165_shapes1.brep] c
|
||||||
|
|
||||||
|
explode c
|
||||||
|
# c_1 is a face
|
||||||
|
# c_2 is a set of edges
|
||||||
|
|
||||||
|
# split the face with the edges
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects c_1
|
||||||
|
baddctools c_2
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
|
||||||
|
checknbshapes result -face 1600
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
28
tests/bugs/modalg_6/bug28165_2
Normal file
28
tests/bugs/modalg_6/bug28165_2
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28165"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# Improve performance of Boolean Operations
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28165_shapes1.brep] c
|
||||||
|
|
||||||
|
explode c
|
||||||
|
# c_1 is a face
|
||||||
|
# c_2 is a set of edges
|
||||||
|
|
||||||
|
# rotate the shapes to make no intersections at all
|
||||||
|
ttranslate c_2 0 0 0.1
|
||||||
|
trotate c_1 c_2 0 0 0 1 1 0 45
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects c_1
|
||||||
|
baddctools c_2
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
|
||||||
|
checknbshapes result -edge 5074 -face 1
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
25
tests/bugs/modalg_6/bug28165_3
Normal file
25
tests/bugs/modalg_6/bug28165_3
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28165"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# Improve performance of Boolean Operations
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28165_shapes2.brep] c
|
||||||
|
|
||||||
|
# fuse the boxes
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects {*}[explode c so]
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
# remove all internal faces to make only one solid
|
||||||
|
bcbuild rx
|
||||||
|
bcaddall result -m 1 -u
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checknbshapes result -edge 816 -face 378 -solid 1
|
||||||
|
checkprops result -v 343
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
25
tests/bugs/modalg_6/bug28165_4
Normal file
25
tests/bugs/modalg_6/bug28165_4
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28165"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# Improve performance of Boolean Operations
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28165_shapes3.brep] c
|
||||||
|
|
||||||
|
# fuse the shapes
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects {*}[explode c so]
|
||||||
|
bfillds
|
||||||
|
|
||||||
|
# remove all internal faces to make only one solid
|
||||||
|
bcbuild rx
|
||||||
|
bcaddall result -m 1 -u
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checknbshapes result -edge 1400 -face 506 -solid 1
|
||||||
|
checkprops result -v 4.69342e+007 -s 1.38778e+006
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user