1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +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:
emv
2016-11-30 13:29:37 +03:00
committed by apn
parent 483ce1bd89
commit 51db017972
31 changed files with 623 additions and 488 deletions

View File

@@ -231,14 +231,15 @@ void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
//=======================================================================
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
gp_Dir& aDNF)
gp_Dir& aDNF,
const Handle(IntTools_Context)& theContext)
{
Standard_Real aT, aT1, aT2;
BRep_Tool::CurveOnSurface(aE, aF, 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){
aDNF.Reverse();
@@ -251,7 +252,8 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
const TopoDS_Face& aF1,
const Standard_Real aT,
gp_Dir& aDNF1)
gp_Dir& aDNF1,
const Handle(IntTools_Context)& theContext)
{
Standard_Real U, V, aTolPC;
gp_Pnt2d aP2D;
@@ -261,7 +263,7 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
Handle(Geom_Surface) aS1=BRep_Tool::Surface(aF1);
Handle(Geom2d_Curve)aC2D1;
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF1, aC2D1, aTolPC);
BOPTools_AlgoTools2D::CurveOnSurface(aE, aF1, aC2D1, aTolPC, theContext);
aC2D1->D0(aT, aP2D);
U=aP2D.X();
@@ -511,7 +513,12 @@ void BOPTools_AlgoTools3D::PointNearEdge
gp_Pnt aP;
gp_Pnt2d aP2d;
//
BRepTools::UVBounds(aF, aU1, aU2, aV1, aV2);
if (theContext.IsNull()) {
BRepTools::UVBounds(aF, aU1, aU2, aV1, aV2);
}
else {
theContext->UVBounds(aF, aU1, aU2, aV1, aV2);
}
//
dU=aU2-aU1;
dV=aV2-aV1;
@@ -750,7 +757,12 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
aFF.Orientation (TopAbs_FORWARD);
//
aS=BRep_Tool::Surface(aFF);
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
if (theContext.IsNull()) {
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
}
else {
theContext->UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
}
//
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
Standard_Integer i;