mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026980: Intersection algorithm spends much system time and system memory
1. Step of Walking-line has been increased as possible and now computes by iteratively adaptive algorithm (every iteration checks if current step is too big/small and decreases/increases one). 2. Interface of IntWalk_PWalking class has been changed 2.1. Method MaxStep() has been added in order to know about maximal distance between 2D-points. 2.2. Method ComputePasInit(...) has been added in order to initial step value computation. 2.3. Fields myTolTang (tolerance for intersection algorithm) and myStepMin (minimal step value) have been added. Correction of some test cases. Creation test case for this issue. Changes to eliminate compiler warnings.
This commit is contained in:
@@ -149,7 +149,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
default:
|
||||
{
|
||||
IntPatch_PrmPrmIntersection interpp;
|
||||
interpp.Perform(S1,D1,TolArc,TolTang,myFleche,myUVMaxStep);
|
||||
interpp.Perform(S1,D1,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
if (interpp.IsDone())
|
||||
{
|
||||
done = Standard_True;
|
||||
@@ -1237,10 +1237,10 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
Standard_Boolean ClearFlag = Standard_True;
|
||||
if(!ListOfPnts.IsEmpty())
|
||||
{
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolArc,TolTang,myFleche,myUVMaxStep, ListOfPnts, RestrictLine);
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep, ListOfPnts, RestrictLine);
|
||||
ClearFlag = Standard_False;
|
||||
}
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolArc,TolTang,myFleche,myUVMaxStep,ClearFlag); //double call!!!!!!!
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep,ClearFlag); //double call!!!!!!!
|
||||
}
|
||||
else if((theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite()))
|
||||
{
|
||||
@@ -1253,7 +1253,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
const Standard_Real AP = Max(MU, MV);
|
||||
Handle(Adaptor3d_HSurface) SS;
|
||||
FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS1, AP, SS);
|
||||
interpp.Perform(SS,theD1,theS2,theD2,TolArc,TolTang,myFleche,myUVMaxStep);
|
||||
interpp.Perform(SS,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1263,7 +1263,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
const Standard_Real AP = Max(MU, MV);
|
||||
Handle(Adaptor3d_HSurface) SS;
|
||||
FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS2, AP, SS);
|
||||
interpp.Perform(theS1, theD1, SS, theD2,TolArc,TolTang,myFleche,myUVMaxStep);
|
||||
interpp.Perform(theS1, theD1, SS, theD2,TolTang, TolArc,myFleche,myUVMaxStep);
|
||||
}
|
||||
}//(theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite())
|
||||
else
|
||||
@@ -1302,7 +1302,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
Handle(Adaptor3d_HSurface) nS1 = theS1;
|
||||
Handle(Adaptor3d_HSurface) nS2 = theS2;
|
||||
FUN_TrimBothSurf(theS1,typs1,theS2,typs2,1.e+8,nS1,nS2);
|
||||
interpp.Perform(nS1,theD1,nS2,theD2,TolArc,TolTang,myFleche,myUVMaxStep);
|
||||
interpp.Perform(nS1,theD1,nS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
}// 'NON - COLLINEAR LINES'
|
||||
}// both domains are infinite
|
||||
|
||||
@@ -1652,7 +1652,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
else
|
||||
{
|
||||
IntPatch_PrmPrmIntersection interpp;
|
||||
interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolArc,TolTang,myFleche,myUVMaxStep);
|
||||
interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
if (interpp.IsDone())
|
||||
{
|
||||
done = Standard_True;
|
||||
|
@@ -77,6 +77,8 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_HSurface)& theSurf1,
|
||||
const IntSurf_TypeTrans theTrans1,
|
||||
const IntSurf_TypeTrans theTrans2,
|
||||
const Standard_Real theTol,
|
||||
const Standard_Real theMaxStepS1,
|
||||
const Standard_Real theMaxStepS2,
|
||||
Handle(IntPatch_WLine)& theWLline)
|
||||
{
|
||||
if(theSLin.Length() == 0)
|
||||
@@ -84,7 +86,6 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_HSurface)& theSurf1,
|
||||
|
||||
Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0;
|
||||
|
||||
const Standard_Real aTol2D = 1.e-4;
|
||||
Standard_Integer cnbV = theWLline->NbVertex();
|
||||
Standard_Integer ciV;
|
||||
for( ciV = 1; ciV <= cnbV; ciV++ )
|
||||
@@ -119,11 +120,14 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_HSurface)& theSurf1,
|
||||
Standard_Real vRs2 = theSurf2->Surface().VResolution(tDistance);
|
||||
Standard_Real RmaxS1 = Max(uRs1,vRs1);
|
||||
Standard_Real RmaxS2 = Max(uRs2,vRs2);
|
||||
if((aPCS1.SquareDistance(aPTS1) < RmaxS1*RmaxS1) && (aPCS2.SquareDistance(aPTS2) < RmaxS2*RmaxS2))
|
||||
|
||||
if(RmaxS1 < theMaxStepS1 && RmaxS2 < theMaxStepS2)
|
||||
{
|
||||
if(RmaxS1 < aTol2D && RmaxS2 < aTol2D)
|
||||
if( pntDMin > tDistance && tDistance > Precision::PConfusion())
|
||||
{
|
||||
if( pntDMin > tDistance && tDistance > 1.e-9)
|
||||
const Standard_Real aSqDist1 = aPCS1.SquareDistance(aPTS1),
|
||||
aSqDist2 = aPCS2.SquareDistance(aPTS2);
|
||||
if((aSqDist1 < RmaxS1*RmaxS1) && (aSqDist2 < RmaxS2*RmaxS2))
|
||||
{
|
||||
pntDMin = tDistance;
|
||||
VDMin = tiV;
|
||||
@@ -1790,7 +1794,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
wline->AddVertex(vtx);
|
||||
}
|
||||
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2, TolTang, wline);
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2,
|
||||
TolTang, Max(PW.MaxStep(0), PW.MaxStep(1)),
|
||||
Max(PW.MaxStep(2), PW.MaxStep(3)), wline);
|
||||
|
||||
AddWLine(SLin, wline, Deflection);
|
||||
empt = Standard_False;
|
||||
@@ -2470,7 +2476,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
lignetrouvee = Standard_True;
|
||||
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2, TolTang, wline);
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2,
|
||||
TolTang, Max(PW.MaxStep(0), PW.MaxStep(1)),
|
||||
Max(PW.MaxStep(2), PW.MaxStep(3)), wline);
|
||||
|
||||
AddWLine(SLin, wline, Deflection);
|
||||
empt = Standard_False;
|
||||
|
Reference in New Issue
Block a user