mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0023914: Intersection algorithm produced too many intersection points
This is draft version. 1. External step limitation has been eliminated. 2. Interfaces of GeomInt_IntSS, IntPatch_Intersection and IntPatch_PrmPrmIntersection classes has been changed. 3. Syntax of "intersect" DRAW-command has been changed (see help for detail information). 4. New statuses have been added in IntWalk_StatusDeflection.hxx file. Main changes are made in IntWalk_PWalking class. Creation of test case for this issue.
This commit is contained in:
@@ -3319,15 +3319,14 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
// At this stage :
|
||||
// classic intersections have failed, the path is approached in vain.
|
||||
|
||||
Standard_Real Step = 0.1;
|
||||
for(;;) {
|
||||
for(Standard_Integer aNbIter = 20;;) {
|
||||
//Attention the parameters of arrow for the path and
|
||||
//the tolerance for the approximation can't be taken as those of the
|
||||
//Builder, so they are reestimated as much as possible.
|
||||
Standard_Real fleche = 1.e-3 * pdeb.Distance(pfin);
|
||||
Standard_Real tolap = 1.e-7;
|
||||
IntWalk_PWalking
|
||||
IntKK(S1,S2,tol3d,tol3d,fleche,Step);
|
||||
IntKK(S1,S2,tol3d,tol3d,fleche);
|
||||
|
||||
//The extremities of the intersection (Pardeb,Parfin) are known,
|
||||
//one tries to find the start point at the
|
||||
@@ -3351,8 +3350,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
IntKK.Perform(depart);
|
||||
if (!IntKK.IsDone()) return Standard_False;
|
||||
if (IntKK.NbPoints() <= 30) {
|
||||
Step *= 0.5;
|
||||
if (Step <= 0.0001) {
|
||||
if (--aNbIter <= 0) {
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
|
@@ -28,14 +28,15 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
const Standard_Real Tol,
|
||||
const Standard_Boolean Approx,
|
||||
const Standard_Boolean ApproxS1,
|
||||
const Standard_Boolean ApproxS2)
|
||||
const Standard_Boolean ApproxS2,
|
||||
const Standard_Boolean theIsReqToPostWLProc)
|
||||
{
|
||||
myHS1 = new GeomAdaptor_HSurface(S1);
|
||||
if (S1==S2)
|
||||
myHS2 = myHS1;
|
||||
else
|
||||
myHS2 = new GeomAdaptor_HSurface(S2);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_False,0.,0.,0.,0.);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_False,0.,0.,0.,0.,theIsReqToPostWLProc);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -49,14 +50,15 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
const Standard_Real U2, const Standard_Real V2,
|
||||
const Standard_Boolean Approx,
|
||||
const Standard_Boolean ApproxS1,
|
||||
const Standard_Boolean ApproxS2)
|
||||
const Standard_Boolean ApproxS2,
|
||||
const Standard_Boolean theIsReqToPostWLProc)
|
||||
{
|
||||
myHS1 = new GeomAdaptor_HSurface(S1);
|
||||
if (S1==S2)
|
||||
myHS2 = myHS1;
|
||||
else
|
||||
myHS2 = new GeomAdaptor_HSurface(S2);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_True,U1,V1,U2,V2);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_True,U1,V1,U2,V2,theIsReqToPostWLProc);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -71,7 +73,8 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real V1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V2)
|
||||
const Standard_Real V2,
|
||||
const Standard_Boolean theIsReqToPostWLProc)
|
||||
{
|
||||
myTolReached2d = myTolReached3d = 0.0;
|
||||
myNbrestr = 0;
|
||||
@@ -82,16 +85,15 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
|
||||
Standard_Real TolArc = Tol;
|
||||
Standard_Real TolTang = Tol;
|
||||
Standard_Real UVMaxStep = 0.001;
|
||||
Standard_Real Deflection = 0.1;
|
||||
|
||||
myIntersector.SetTolerances(TolArc,TolTang,UVMaxStep,Deflection);
|
||||
myIntersector.SetTolerances(TolArc,TolTang,Deflection);
|
||||
|
||||
if(myHS1 == myHS2) {
|
||||
myIntersector.Perform(myHS1,dom1,TolArc,TolTang);
|
||||
}
|
||||
else if (!useStart) {
|
||||
myIntersector.Perform(myHS1,dom1,myHS2,dom2,TolArc,TolTang);
|
||||
myIntersector.Perform(myHS1,dom1,myHS2,dom2,TolArc,TolTang,Standard_True, Standard_False, theIsReqToPostWLProc);
|
||||
}
|
||||
else {
|
||||
myIntersector.Perform(myHS1,dom1,myHS2,dom2,U1,V1,U2,V2,TolArc,TolTang);
|
||||
|
@@ -57,16 +57,16 @@ public:
|
||||
GeomInt_IntSS(const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
|
||||
|
||||
//! general intersection of two surfaces
|
||||
Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
|
||||
Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False, const Standard_Boolean theIsReqToPostWLProc = Standard_True);
|
||||
|
||||
//! intersection of adapted surfaces
|
||||
void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
|
||||
void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False, const Standard_Boolean theIsReqToPostWLProc = Standard_True);
|
||||
|
||||
//! general intersection using a starting point
|
||||
Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
|
||||
Standard_EXPORT void Perform (const Handle(Geom_Surface)& S1, const Handle(Geom_Surface)& S2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False, const Standard_Boolean theIsReqToPostWLProc = Standard_True);
|
||||
|
||||
//! intersection of adapted surfaces using a starting point
|
||||
void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False);
|
||||
void Perform (const Handle(GeomAdaptor_HSurface)& HS1, const Handle(GeomAdaptor_HSurface)& HS2, const Standard_Real Tol, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean Approx = Standard_True, const Standard_Boolean ApproxS1 = Standard_False, const Standard_Boolean ApproxS2 = Standard_False, const Standard_Boolean theIsReqToPostWLProc = Standard_True);
|
||||
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void InternalPerform (const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean ApproxS1, const Standard_Boolean ApproxS2, const Standard_Boolean useStart, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
|
||||
Standard_EXPORT void InternalPerform (const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean ApproxS1, const Standard_Boolean ApproxS2, const Standard_Boolean useStart, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Boolean theIsReqToPostWLProc);
|
||||
|
||||
Standard_EXPORT void MakeCurve (const Standard_Integer Ind, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real Tol, const Standard_Boolean Approx, const Standard_Boolean Approx1, const Standard_Boolean Approx2);
|
||||
|
||||
|
@@ -58,11 +58,12 @@ inline GeomInt_IntSS::GeomInt_IntSS ()
|
||||
const Standard_Real Tol,
|
||||
const Standard_Boolean Approx,
|
||||
const Standard_Boolean ApproxS1,
|
||||
const Standard_Boolean ApproxS2)
|
||||
const Standard_Boolean ApproxS2,
|
||||
const Standard_Boolean theIsReqToPostWLProc)
|
||||
{
|
||||
myHS1 = HS1;
|
||||
myHS2 = HS2;
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_False,0.,0.,0.,0.);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_False,0.,0.,0.,0.,theIsReqToPostWLProc);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -76,11 +77,12 @@ inline GeomInt_IntSS::GeomInt_IntSS ()
|
||||
const Standard_Real U2, const Standard_Real V2,
|
||||
const Standard_Boolean Approx,
|
||||
const Standard_Boolean ApproxS1,
|
||||
const Standard_Boolean ApproxS2)
|
||||
const Standard_Boolean ApproxS2,
|
||||
const Standard_Boolean theIsReqToPostWLProc)
|
||||
{
|
||||
myHS1 = HS1;
|
||||
myHS2 = HS2;
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_True,U1,V1,U2,V2);
|
||||
InternalPerform(Tol,Approx,ApproxS1,ApproxS2,Standard_True,U1,V1,U2,V2,theIsReqToPostWLProc);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -1496,11 +1496,45 @@ static Standard_Integer intersection (Draw_Interpretor& di,
|
||||
if (GS2.IsNull())
|
||||
return 1;
|
||||
|
||||
//
|
||||
Handle(GeomAdaptor_HSurface) AS1,AS2;
|
||||
Standard_Real tol = Precision::Confusion();
|
||||
if (n == 5 || n == 9 || n == 13 || n == 17)
|
||||
tol = Draw::Atof(a[n-1]);
|
||||
Standard_Real UVsta[4];
|
||||
Standard_Boolean useStart = Standard_False, useBnd = Standard_False, isPostProcessingReq = Standard_True;
|
||||
|
||||
for(Standard_Integer i = 4; i < n; i++)
|
||||
{
|
||||
if(!strcmp(a[i], "-sp"))
|
||||
{
|
||||
useStart = Standard_True;
|
||||
for(Standard_Integer j = 0; j < 4; j++)
|
||||
{
|
||||
UVsta[j] = Draw::Atof(a[++i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!strcmp(a[i], "-b"))
|
||||
{
|
||||
Standard_Real UVbnd[8];
|
||||
useBnd = Standard_True;
|
||||
for(Standard_Integer j = 0; j < 4; j++)
|
||||
{
|
||||
UVbnd[j] = Draw::Atof(a[++i]);
|
||||
}
|
||||
|
||||
AS1 = new GeomAdaptor_HSurface(GS1,UVbnd[0],UVbnd[1],UVbnd[2],UVbnd[3]);
|
||||
AS2 = new GeomAdaptor_HSurface(GS2,UVbnd[4],UVbnd[5],UVbnd[6],UVbnd[7]);
|
||||
}
|
||||
|
||||
if(!strcmp(a[i], "-t"))
|
||||
{
|
||||
tol = Draw::Atof(a[++i]);
|
||||
}
|
||||
|
||||
if(!strcmp(a[i], "-npp"))
|
||||
{
|
||||
isPostProcessingReq = Standard_False;
|
||||
}
|
||||
}
|
||||
//
|
||||
Handle(Geom_Curve) Result;
|
||||
gp_Pnt Point;
|
||||
@@ -1509,76 +1543,24 @@ static Standard_Integer intersection (Draw_Interpretor& di,
|
||||
if (GC1.IsNull())
|
||||
{
|
||||
GeomInt_IntSS Inters;
|
||||
//
|
||||
// Surface Surface
|
||||
if (n <= 5)
|
||||
|
||||
if(!useStart && !useBnd)
|
||||
{
|
||||
// General case
|
||||
Inters.Perform(GS1,GS2,tol,Standard_True);
|
||||
Inters.Perform(GS1,GS2,tol,Standard_True, Standard_False, Standard_False, isPostProcessingReq);
|
||||
}
|
||||
else if (n == 8 || n == 9 || n == 12 || n == 13 || n == 16 || n == 17)
|
||||
else if (useStart && !useBnd)
|
||||
{
|
||||
Standard_Boolean useStart = Standard_True, useBnd = Standard_True;
|
||||
Standard_Integer ista1=0,ista2=0,ibnd1=0,ibnd2=0;
|
||||
Standard_Real UVsta[4];
|
||||
Handle(GeomAdaptor_HSurface) AS1,AS2;
|
||||
|
||||
//
|
||||
if (n <= 9) // user starting point
|
||||
{
|
||||
useBnd = Standard_False;
|
||||
ista1 = 4;
|
||||
ista2 = 7;
|
||||
}
|
||||
else if (n <= 13) // user bounding
|
||||
{
|
||||
useStart = Standard_False;
|
||||
ibnd1 = 4; ibnd2 = 11;
|
||||
}
|
||||
else // both user starting point and bounding
|
||||
{
|
||||
ista1 = 4; ista2 = 7;
|
||||
ibnd1 = 8; ibnd2 = 15;
|
||||
}
|
||||
|
||||
if (useStart)
|
||||
{
|
||||
for (Standard_Integer i=ista1; i <= ista2; i++)
|
||||
{
|
||||
UVsta[i-ista1] = Draw::Atof(a[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (useBnd)
|
||||
{
|
||||
Standard_Real UVbnd[8];
|
||||
for (Standard_Integer i=ibnd1; i <= ibnd2; i++)
|
||||
UVbnd[i-ibnd1] = Draw::Atof(a[i]);
|
||||
|
||||
AS1 = new GeomAdaptor_HSurface(GS1,UVbnd[0],UVbnd[1],UVbnd[2],UVbnd[3]);
|
||||
AS2 = new GeomAdaptor_HSurface(GS2,UVbnd[4],UVbnd[5],UVbnd[6],UVbnd[7]);
|
||||
}
|
||||
|
||||
//
|
||||
if (useStart && !useBnd)
|
||||
{
|
||||
Inters.Perform(GS1,GS2,tol,UVsta[0],UVsta[1],UVsta[2],UVsta[3]);
|
||||
Inters.Perform(GS1,GS2,tol,UVsta[0],UVsta[1],UVsta[2],UVsta[3], Standard_True, Standard_False, Standard_False, Standard_True);
|
||||
}
|
||||
else if (!useStart && useBnd)
|
||||
{
|
||||
Inters.Perform(AS1,AS2,tol);
|
||||
Inters.Perform(AS1,AS2,tol,Standard_True, Standard_False, Standard_False, Standard_True);
|
||||
}
|
||||
else
|
||||
{
|
||||
Inters.Perform(AS1,AS2,tol,UVsta[0],UVsta[1],UVsta[2],UVsta[3]);
|
||||
Inters.Perform(AS1,AS2,tol,UVsta[0],UVsta[1],UVsta[2],UVsta[3], Standard_True, Standard_False, Standard_False, Standard_True);
|
||||
}
|
||||
}//else if (n == 8 || n == 9 || n == 12 || n == 13 || n == 16 || n == 17)
|
||||
else
|
||||
{
|
||||
di<<"incorrect number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
//
|
||||
if (!Inters.IsDone())
|
||||
{
|
||||
@@ -1798,8 +1780,9 @@ void GeometryTest::CurveCommands(Draw_Interpretor& theCommands)
|
||||
g = "GEOMETRY intersections";
|
||||
|
||||
theCommands.Add("intersect",
|
||||
"intersect result surf1/curv1 surf2 [tolerance]\n\t\t "
|
||||
"intersect result surf1 surf2 [u1 v1 u2 v2] [U1F U1L V1F V1L U2F U2L V2F V2L] [tolerance]",
|
||||
"intersect result surf1 surf2 [-sp u1 v1 u2 v2] [-b U1F U1L V1F V1L U2F U2L V2F V2L] [-t tolerance] [-npp] : "
|
||||
"Use:\n -sp option for setting start point;\n -b option for setting bounds;\n "
|
||||
"-t option for setting tolerance;\n -npp option for switching off post-processing intersection line (e.g. avoid purger)",
|
||||
__FILE__,
|
||||
intersection,g);
|
||||
|
||||
|
@@ -47,7 +47,7 @@ IntPatch_Intersection::IntPatch_Intersection ()
|
||||
: done(Standard_False),
|
||||
//empt, tgte, oppo,
|
||||
myTolArc(0.0), myTolTang(0.0),
|
||||
myUVMaxStep(0.0), myFleche(0.0),
|
||||
myFleche(0.0),
|
||||
myIsStartPnt(Standard_False)
|
||||
//myU1Start, myV1Start, myU2Start, myV2Start
|
||||
{
|
||||
@@ -65,7 +65,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_HSurface)&
|
||||
: done(Standard_False),
|
||||
//empt, tgte, oppo,
|
||||
myTolArc(TolArc), myTolTang(TolTang),
|
||||
myUVMaxStep(0.0), myFleche(0.0),
|
||||
myFleche(0.0),
|
||||
myIsStartPnt(Standard_False)
|
||||
//myU1Start, myV1Start, myU2Start, myV2Start
|
||||
{
|
||||
@@ -86,7 +86,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_HSurface)&
|
||||
: done(Standard_False),
|
||||
//empt, tgte, oppo,
|
||||
myTolArc(TolArc), myTolTang(TolTang),
|
||||
myUVMaxStep(0.0), myFleche(0.0),
|
||||
myFleche(0.0),
|
||||
myIsStartPnt(Standard_False)
|
||||
//myU1Start, myV1Start, myU2Start, myV2Start
|
||||
{
|
||||
@@ -98,21 +98,17 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_HSurface)&
|
||||
//======================================================================
|
||||
void IntPatch_Intersection::SetTolerances(const Standard_Real TolArc,
|
||||
const Standard_Real TolTang,
|
||||
const Standard_Real UVMaxStep,
|
||||
const Standard_Real Fleche)
|
||||
{
|
||||
myTolArc = TolArc;
|
||||
myTolTang = TolTang;
|
||||
myUVMaxStep = UVMaxStep;
|
||||
myFleche = Fleche;
|
||||
if(myTolArc<1e-8) myTolArc=1e-8;
|
||||
if(myTolTang<1e-8) myTolTang=1e-8;
|
||||
if(myTolArc>0.5) myTolArc=0.5;
|
||||
if(myTolTang>0.5) myTolTang=0.5;
|
||||
if(myFleche<1.0e-3) myFleche=1e-3;
|
||||
if(myUVMaxStep<1.0e-3) myUVMaxStep=1e-3;
|
||||
if(myFleche>10) myFleche=10;
|
||||
if(myUVMaxStep>0.5) myUVMaxStep=0.5;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -126,7 +122,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
myTolArc = TolArc;
|
||||
myTolTang = TolTang;
|
||||
if(myFleche == 0.0) myFleche = 0.01;
|
||||
if(myUVMaxStep==0.0) myUVMaxStep = 0.01;
|
||||
|
||||
done = Standard_True;
|
||||
spnt.Clear();
|
||||
@@ -169,7 +164,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
default:
|
||||
{
|
||||
IntPatch_PrmPrmIntersection interpp;
|
||||
interpp.Perform(S1,D1,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(S1,D1,TolTang,TolArc,myFleche);
|
||||
if (interpp.IsDone())
|
||||
{
|
||||
done = Standard_True;
|
||||
@@ -746,8 +741,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
myTolTang = TolTang;
|
||||
if(myFleche <= Precision::PConfusion())
|
||||
myFleche = 0.01;
|
||||
if(myUVMaxStep <= Precision::PConfusion())
|
||||
myUVMaxStep = 0.01;
|
||||
|
||||
done = Standard_False;
|
||||
spnt.Clear();
|
||||
@@ -1008,8 +1001,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
myTolTang = TolTang;
|
||||
if(myFleche <= Precision::PConfusion())
|
||||
myFleche = 0.01;
|
||||
if(myUVMaxStep <= Precision::PConfusion())
|
||||
myUVMaxStep = 0.01;
|
||||
|
||||
done = Standard_False;
|
||||
spnt.Clear();
|
||||
@@ -1245,10 +1236,10 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_HSurface)&
|
||||
Standard_Boolean ClearFlag = Standard_True;
|
||||
if(!ListOfPnts.IsEmpty())
|
||||
{
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep, ListOfPnts, RestrictLine);
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche, ListOfPnts, RestrictLine);
|
||||
ClearFlag = Standard_False;
|
||||
}
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep,ClearFlag); //double call!!!!!!!
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,ClearFlag); //double call!!!!!!!
|
||||
}
|
||||
else if((theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite()))
|
||||
{
|
||||
@@ -1261,7 +1252,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,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(SS,theD1,theS2,theD2,TolTang,TolArc,myFleche);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1271,7 +1262,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,TolTang, TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(theS1, theD1, SS, theD2,TolTang, TolArc,myFleche);
|
||||
}
|
||||
}//(theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite())
|
||||
else
|
||||
@@ -1310,7 +1301,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,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(nS1,theD1,nS2,theD2,TolTang,TolArc,myFleche);
|
||||
}// 'NON - COLLINEAR LINES'
|
||||
}// both domains are infinite
|
||||
|
||||
@@ -1505,11 +1496,11 @@ void IntPatch_Intersection::
|
||||
Handle(Adaptor3d_HSurface) nS1 = theS1;
|
||||
Handle(Adaptor3d_HSurface) nS2 = theS2;
|
||||
FUN_TrimBothSurf(theS1,typs1,theS2,typs2,1.e+5,nS1,nS2);
|
||||
interip.Perform(nS1,theD1,nS2,theD2,myTolArc,myTolTang,myFleche,myUVMaxStep);
|
||||
interip.Perform(nS1,theD1,nS2,theD2,myTolArc,myTolTang,myFleche, 0.001);
|
||||
}
|
||||
}
|
||||
else
|
||||
interip.Perform(theS1,theD1,theS2,theD2,myTolArc,myTolTang,myFleche,myUVMaxStep);
|
||||
interip.Perform(theS1,theD1,theS2,theD2,myTolArc,myTolTang,myFleche, 0.001);
|
||||
|
||||
if (interip.IsDone())
|
||||
{
|
||||
@@ -1557,13 +1548,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
#endif
|
||||
myFleche = 0.01;
|
||||
}
|
||||
if(myUVMaxStep==0.0) {
|
||||
#if DEBUG
|
||||
//cout<<" -- IntPatch_Intersection::myUVMaxStep fixe par defaut a 0.01 --"<<endl;
|
||||
//cout<<" -- Utiliser la Methode SetTolerances( ... ) "<<endl;
|
||||
#endif
|
||||
myUVMaxStep = 0.01;
|
||||
}
|
||||
|
||||
done = Standard_False;
|
||||
spnt.Clear();
|
||||
@@ -1593,7 +1577,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
else
|
||||
{
|
||||
IntPatch_PrmPrmIntersection interpp;
|
||||
interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolTang,TolArc,myFleche);
|
||||
if (interpp.IsDone())
|
||||
{
|
||||
done = Standard_True;
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
//! UVMaxStep is a parameter used in the walking
|
||||
//! algorithms to compute the distance between to
|
||||
//! points in their respective parametrtic spaces.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real UVMaxStep, const Standard_Real Fleche);
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real Fleche);
|
||||
|
||||
//! Flag theIsReqToKeepRLine has been enterred only for
|
||||
//! compatibility with TopOpeBRep package. It shall be deleted
|
||||
@@ -178,7 +178,6 @@ private:
|
||||
IntPatch_SequenceOfLine slin;
|
||||
Standard_Real myTolArc;
|
||||
Standard_Real myTolTang;
|
||||
Standard_Real myUVMaxStep;
|
||||
Standard_Real myFleche;
|
||||
Standard_Boolean myIsStartPnt;
|
||||
Standard_Real myU1Start;
|
||||
|
@@ -313,11 +313,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& S
|
||||
const Handle(Adaptor3d_TopolTool)& D1,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
IntPatch_Polyhedron Poly1( Surf1, D1->NbSamplesU(), D1->NbSamplesV() );
|
||||
Perform( Surf1, Poly1, D1, TolTangency, Epsilon, Deflection, Increment );
|
||||
Perform( Surf1, Poly1, D1, TolTangency, Epsilon, Deflection);
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
@@ -331,11 +330,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& S
|
||||
const Handle(Adaptor3d_TopolTool)& D2,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
IntPatch_Polyhedron Poly2( Surf2 );
|
||||
Perform( Surf1, Poly1, D1, Surf2, Poly2, D2, TolTangency, Epsilon, Deflection, Increment);
|
||||
Perform( Surf1, Poly1, D1, Surf2, Poly2, D2, TolTangency, Epsilon, Deflection);
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
@@ -349,11 +347,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& S
|
||||
const Handle(Adaptor3d_TopolTool)& D2,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
IntPatch_Polyhedron Poly1( Surf1 );
|
||||
Perform( Surf1, Poly1, D1, Surf2, Poly2, D2, TolTangency, Epsilon, Deflection, Increment );
|
||||
Perform( Surf1, Poly1, D1, Surf2, Poly2, D2, TolTangency, Epsilon, Deflection);
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
@@ -368,8 +365,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
const Handle(Adaptor3d_TopolTool)& D2,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
IntPatch_InterferencePolyhedron Interference(Poly1,Poly2);
|
||||
empt = Standard_True;
|
||||
@@ -386,12 +382,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
|
||||
IntWalk_PWalking PW( Surf1, Surf2, TolTangency, Epsilon, Deflection, Increment );
|
||||
|
||||
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
|
||||
Standard_Real incidence;
|
||||
Standard_Real dminiPointLigne;
|
||||
IntWalk_PWalking PW( Surf1, Surf2, TolTangency, Epsilon, Deflection);
|
||||
|
||||
Standard_Real SeuildPointLigne = 4.0*PW.MaxStep(); //-- 10 est insuffisant
|
||||
Standard_Real incidence, dminiPointLigne;
|
||||
Standard_Boolean HasStartPoint, RejetLigne;
|
||||
|
||||
IntSurf_PntOn2S StartPOn2S;
|
||||
@@ -400,6 +394,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
gp_Pnt Point3dDebut,Point3dFin;
|
||||
|
||||
SeuildPointLigne *= SeuildPointLigne;
|
||||
|
||||
if( nbLigSec >= 1 ) {
|
||||
Standard_Integer *TabL = new Standard_Integer [nbLigSec+1];
|
||||
Standard_Integer ls;
|
||||
@@ -775,8 +771,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
const Handle(Adaptor3d_TopolTool)& D1,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
IntPatch_InterferencePolyhedron Interference(Poly1);
|
||||
empt = Standard_True;
|
||||
@@ -793,9 +788,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
Standard_Real pu1,pu2,pv1,pv2;
|
||||
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
IntWalk_PWalking PW(Surf1,Surf1,TolTangency,Epsilon,Deflection,Increment);
|
||||
IntWalk_PWalking PW(Surf1,Surf1,TolTangency,Epsilon,Deflection);
|
||||
|
||||
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
|
||||
Standard_Real SeuildPointLigne = 4.0*PW.MaxStep(); //-- 10 est insuffisant
|
||||
Standard_Real incidence;
|
||||
Standard_Real dminiPointLigne;
|
||||
|
||||
@@ -806,6 +801,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
Standard_Integer ver;
|
||||
|
||||
gp_Pnt Point3dDebut,Point3dFin;
|
||||
SeuildPointLigne *= SeuildPointLigne;
|
||||
|
||||
if(nbLigSec>=1) {
|
||||
Standard_Integer ls;
|
||||
@@ -1245,7 +1241,7 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor
|
||||
V2(Low) = v2;
|
||||
AC(Low) =0.0;
|
||||
|
||||
IntWalk_PWalking PW(Surf1,Surf2,0.000001,0.000001,0.001,0.001);
|
||||
IntWalk_PWalking PW(Surf1,Surf2,0.000001,0.000001,0.001);
|
||||
|
||||
Standard_Integer i;
|
||||
for(i=Low+1; i<=High; i++)
|
||||
@@ -1534,7 +1530,6 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment,
|
||||
IntSurf_ListOfPntOn2S& LOfPnts,
|
||||
const Standard_Boolean RestrictLine)
|
||||
{
|
||||
@@ -1675,7 +1670,6 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
if(V2<VminLig2) VminLig2=V2;
|
||||
}
|
||||
|
||||
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment;
|
||||
|
||||
Standard_Integer NbLigCalculee = 0, ver;
|
||||
Standard_Real pu1,pu2,pv1,pv2, dminiPointLigne;
|
||||
@@ -1684,7 +1678,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
gp_Pnt Point3dDebut,Point3dFin;
|
||||
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment);
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection);
|
||||
Standard_Real SeuildPointLigne = 4.0 * PW.MaxStep();
|
||||
SeuildPointLigne *= SeuildPointLigne;
|
||||
|
||||
IntSurf_ListIteratorOfListOfPntOn2S IterLOP2(LOfPnts);
|
||||
for(; IterLOP2.More(); IterLOP2.Next() ){
|
||||
@@ -1795,8 +1791,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
}
|
||||
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2,
|
||||
TolTang, Max(PW.MaxStep(0), PW.MaxStep(1)),
|
||||
Max(PW.MaxStep(2), PW.MaxStep(3)), wline);
|
||||
TolTang, Max(PW.Step(0), PW.Step(1)),
|
||||
Max(PW.Step(2), PW.Step(3)), wline);
|
||||
|
||||
AddWLine(SLin, wline, Deflection);
|
||||
empt = Standard_False;
|
||||
@@ -1823,8 +1819,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
||||
const Standard_Real V2Depart,
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment)
|
||||
const Standard_Real Deflection)
|
||||
{
|
||||
// Standard_Integer NbU1 = D1->NbSamplesU();
|
||||
// Standard_Integer NbV1 = D1->NbSamplesV();
|
||||
@@ -1858,8 +1853,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
||||
IntWalk_PWalking PW(Surf1,Surf2,
|
||||
TolTangency,
|
||||
Epsilon,
|
||||
Deflection,
|
||||
Increment); //nIncrement);
|
||||
Deflection); //nIncrement);
|
||||
|
||||
|
||||
//Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
|
||||
@@ -2098,7 +2092,6 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
const Standard_Real TolTangency,
|
||||
const Standard_Real Epsilon,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Real Increment,
|
||||
const Standard_Boolean ClearFlag)
|
||||
{
|
||||
Standard_Integer Limit = 2500;
|
||||
@@ -2169,7 +2162,6 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
Standard_Integer nbLigSec = Interference.NbSectionLines();
|
||||
Standard_Integer nbTanZon = Interference.NbTangentZones();
|
||||
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment;
|
||||
|
||||
Standard_Integer NbLigCalculee = 0, ver;
|
||||
Standard_Real pu1,pu2,pv1,pv2, incidence, dminiPointLigne;
|
||||
@@ -2178,7 +2170,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
gp_Pnt Point3dDebut,Point3dFin;
|
||||
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment);
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection);
|
||||
Standard_Real SeuildPointLigne = 4.0 * PW.MaxStep();
|
||||
SeuildPointLigne *= SeuildPointLigne;
|
||||
|
||||
if(nbLigSec>=1)
|
||||
{
|
||||
@@ -2345,10 +2339,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
PW.PutToBoundary(Surf1, Surf2);
|
||||
|
||||
const Standard_Integer aMinNbPoints = 40;
|
||||
if(PW.NbPoints() < aMinNbPoints)
|
||||
{
|
||||
hasBeenAdded = PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
|
||||
}
|
||||
//if(PW.NbPoints() < aMinNbPoints)
|
||||
//{
|
||||
// hasBeenAdded = PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
|
||||
//}
|
||||
|
||||
Standard_Integer iPWNbPoints = PW.NbPoints(), aNbPointsVer = 0;
|
||||
RejectLine = Standard_False;
|
||||
@@ -2473,8 +2467,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
lignetrouvee = Standard_True;
|
||||
|
||||
SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2,
|
||||
TolTang, Max(PW.MaxStep(0), PW.MaxStep(1)),
|
||||
Max(PW.MaxStep(2), PW.MaxStep(3)), wline);
|
||||
TolTang, Max(PW.Step(0), PW.Step(1)),
|
||||
Max(PW.Step(2), PW.Step(3)), wline);
|
||||
|
||||
AddWLine(SLin, wline, Deflection);
|
||||
empt = Standard_False;
|
||||
@@ -2586,11 +2580,11 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
Standard_Boolean hasBeenAdded = Standard_False;
|
||||
if(PW.NbPoints()>2)
|
||||
{
|
||||
const Standard_Integer aMinNbPoints = 40;
|
||||
if(PW.NbPoints() < aMinNbPoints)
|
||||
{
|
||||
hasBeenAdded = PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
|
||||
}
|
||||
//const Standard_Integer aMinNbPoints = 40;
|
||||
//if(PW.NbPoints() < aMinNbPoints)
|
||||
//{
|
||||
// PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
|
||||
//}
|
||||
|
||||
//-----------------------------------------------
|
||||
//-- Verification a posteriori :
|
||||
@@ -2721,12 +2715,14 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
if(MaxOscill < NbV1) MaxOscill=NbV1;
|
||||
if(MaxOscill < NbV2) MaxOscill=NbV2;
|
||||
|
||||
Standard_Real nIncrement=Increment;
|
||||
//Standard_Real nIncrement=Increment;
|
||||
//if(MaxOscill>10)
|
||||
//nIncrement/=0.5*MaxOscill;
|
||||
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,nIncrement);
|
||||
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
|
||||
IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection);
|
||||
Standard_Real SeuildPointLigne = 4.0 * PW.MaxStep(); //-- 10 est insuffisant
|
||||
SeuildPointLigne *= SeuildPointLigne;
|
||||
|
||||
Standard_Real dminiPointLigne;
|
||||
Standard_Boolean HasStartPoint,RejetLigne;
|
||||
IntSurf_PntOn2S StartPOn2S;
|
||||
|
@@ -56,29 +56,29 @@ public:
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>. Associated Polyhedrons <Polyhedron1>
|
||||
//! and <Polyhedron2> are given.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const IntPatch_Polyhedron& Polyhedron2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const IntPatch_Polyhedron& Polyhedron2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>. The method computes the polyhedron on
|
||||
//! each surface.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment, const Standard_Boolean ClearFlag = Standard_True);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Boolean ClearFlag = Standard_True);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>. The method computes the polyhedron on
|
||||
//! each surface.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment, IntSurf_ListOfPntOn2S& ListOfPnts, const Standard_Boolean RestrictLine);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, IntSurf_ListOfPntOn2S& ListOfPnts, const Standard_Boolean RestrictLine);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>. The method computes the polyhedron on
|
||||
//! each surface.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>. The method computes the polyhedron on
|
||||
//! each surface.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>.
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
//! The polyhedron which approximates <Caro2>,
|
||||
//! <Polyhedron2> is given. The other one is
|
||||
//! computed.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const IntPatch_Polyhedron& Polyhedron2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const IntPatch_Polyhedron& Polyhedron2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Performs the intersection between <Caro1> and
|
||||
//! <Caro2>.
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
//! The polyhedron which approximates <Caro1>,
|
||||
//! <Polyhedron1> is given. The other one is
|
||||
//! computed.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Caro1, const IntPatch_Polyhedron& Polyhedron1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Caro2, const Handle(Adaptor3d_TopolTool)& Domain2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Returns true if the calculus was succesfull.
|
||||
Standard_Boolean IsDone() const;
|
||||
|
@@ -553,11 +553,7 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
||||
|
||||
Tolerances(myHS1, myHS2, TolTang);
|
||||
|
||||
{
|
||||
const Standard_Real UVMaxStep = 0.001;
|
||||
const Standard_Real Deflection = 0.1;
|
||||
myIntersector.SetTolerances(TolArc, TolTang, UVMaxStep, Deflection);
|
||||
}
|
||||
myIntersector.SetTolerances(TolArc, TolTang, 0.1);
|
||||
|
||||
if((myHS1->IsUClosed() && !myHS1->IsUPeriodic()) ||
|
||||
(myHS1->IsVClosed() && !myHS1->IsVPeriodic()) ||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -66,7 +66,7 @@ public:
|
||||
//! border of one of the domains. If an open line
|
||||
//! stops at the middle of a domain, one stops at the tangent point.
|
||||
//! Epsilon is SquareTolerance of points confusion.
|
||||
Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_HSurface)& Caro2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment);
|
||||
Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_HSurface)& Caro2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection);
|
||||
|
||||
//! Returns the intersection line containing the exact
|
||||
//! point Poin. This line is a polygonal line.
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
//! border of one of the domains. If an open line
|
||||
//! stops at the middle of a domain, one stops at the tangent point.
|
||||
//! Epsilon is SquareTolerance of points confusion.
|
||||
Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_HSurface)& Caro2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Increment, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
|
||||
Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_HSurface)& Caro1, const Handle(Adaptor3d_HSurface)& Caro2, const Standard_Real TolTangency, const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
|
||||
|
||||
//! calculate the line of intersection
|
||||
Standard_EXPORT void Perform (const TColStd_Array1OfReal& ParDep);
|
||||
@@ -126,32 +126,40 @@ public:
|
||||
|
||||
const gp_Dir& TangentAtLine (Standard_Integer& Index) const;
|
||||
|
||||
Standard_EXPORT IntWalk_StatusDeflection TestDeflection (const IntImp_ConstIsoparametric ChoixIso) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean TestArret (const Standard_Boolean DejaReparti, TColStd_Array1OfReal& Param, IntImp_ConstIsoparametric& ChoixIso);
|
||||
|
||||
Standard_EXPORT void RepartirOuDiviser (Standard_Boolean& DejaReparti, IntImp_ConstIsoparametric& ChoixIso, Standard_Boolean& Arrive);
|
||||
|
||||
void AddAPoint (Handle(IntSurf_LineOn2S)& line, const IntSurf_PntOn2S& POn2S);
|
||||
|
||||
Standard_EXPORT Standard_Boolean PutToBoundary (const Handle(Adaptor3d_HSurface)& theASurf1, const Handle(Adaptor3d_HSurface)& theASurf2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean SeekAdditionalPoints (const Handle(Adaptor3d_HSurface)& theASurf1, const Handle(Adaptor3d_HSurface)& theASurf2, const Standard_Integer theMinNbPoints);
|
||||
|
||||
Standard_Real MaxStep(Standard_Integer theIndex)
|
||||
Standard_Real Step(Standard_Integer theIndex) const
|
||||
{
|
||||
Standard_OutOfRange_Raise_if((theIndex < 0) || (theIndex > 3), "");
|
||||
return pasInit[theIndex];
|
||||
return myRelMaxStep*pasInit[theIndex];
|
||||
}
|
||||
|
||||
Standard_Real MaxStep(void) const
|
||||
{
|
||||
Standard_Real aRetVal = pasInit[0];
|
||||
|
||||
for(Standard_Integer i = 1; i < 4; i++)
|
||||
aRetVal = Max(aRetVal, pasInit[i]);
|
||||
|
||||
return myRelMaxStep*aRetVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
IntWalk_PWalking operator=(const IntWalk_PWalking&);
|
||||
|
||||
Standard_EXPORT void ComputePasInit(const Standard_Real theDeltaU1,
|
||||
const Standard_Real theDeltaV1,
|
||||
const Standard_Real theDeltaU2,
|
||||
const Standard_Real theDeltaV2);
|
||||
|
||||
Standard_EXPORT IntWalk_StatusDeflection TestDeflection (const IntImp_ConstIsoparametric ChoixIso) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean TestArret (const Standard_Boolean DejaReparti, TColStd_Array1OfReal& Param, IntImp_ConstIsoparametric& ChoixIso);
|
||||
//! Uses Gradient method in order to find intersection point between the given surfaces
|
||||
//! Arrays theInit (initial point to be precise) and theStep0 (steps-array) must contain
|
||||
//! four items and must be filled strictly in following order:
|
||||
@@ -161,6 +169,7 @@ protected:
|
||||
TColStd_Array1OfReal& theInit,
|
||||
const Standard_Real* theStep0 = 0);
|
||||
|
||||
|
||||
//! Finds the point on theASurf which is the nearest point to theP0.
|
||||
//! theU0 and theV0 must be initialized (before calling the method) by initial
|
||||
//! parameters on theASurf. Their values are changed while algorithm being launched.
|
||||
@@ -172,6 +181,7 @@ protected:
|
||||
Standard_Real& theV0,
|
||||
const Standard_Real* theStep0 = 0);
|
||||
|
||||
|
||||
//! Searches an intersection point which lies on the some surface boundary.
|
||||
//! Found point (in case of successful result) is added in the line.
|
||||
//! theU1, theV1, theU2 and theV2 parameters are initial parameters in
|
||||
@@ -191,6 +201,8 @@ protected:
|
||||
const Standard_Real theV2,
|
||||
const Standard_Boolean isTheFirst);
|
||||
|
||||
Standard_EXPORT IntWalk_StatusDeflection IntersPerform(const Standard_Boolean theIsForceAdd, IntImp_ConstIsoparametric& theInitIsoChoosen, math_FunctionSetRoot& theRSFunc, Standard_Real theDeltaParam[4]);
|
||||
Standard_EXPORT void ContinueInAnotherDirection(IntImp_ConstIsoparametric& ChoixIso);
|
||||
|
||||
// Method to handle single singular point. Sub-method in SeekPointOnBoundary.
|
||||
Standard_EXPORT Standard_Boolean HandleSingleSingularPoint(const Handle(Adaptor3d_HSurface) &theASurf1,
|
||||
@@ -198,10 +210,12 @@ protected:
|
||||
const Standard_Real the3DTol,
|
||||
TColStd_Array1OfReal &thePnt);
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean ExtendLineInCommonZone (const IntImp_ConstIsoparametric theChoixIso,
|
||||
const Standard_Boolean theDirectionFlag);
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean done;
|
||||
Handle(IntSurf_LineOn2S) line;
|
||||
Standard_Boolean close;
|
||||
@@ -210,25 +224,18 @@ private:
|
||||
Standard_Integer indextg;
|
||||
gp_Dir tgdir;
|
||||
Standard_Real fleche;
|
||||
Standard_Real pasMax;
|
||||
Standard_Real tolconf;
|
||||
Standard_Real myTolTang;
|
||||
Standard_Real pasuv[4];
|
||||
const Standard_Real myRelMaxStep;
|
||||
const Standard_Real myIncMultiplier;
|
||||
const Standard_Real myDecMultiplier;
|
||||
Standard_Real myStepMin[4];
|
||||
Standard_Real pasSav[4];
|
||||
Standard_Real pasInit[4];
|
||||
Standard_Real Um1;
|
||||
Standard_Real UM1;
|
||||
Standard_Real Vm1;
|
||||
Standard_Real VM1;
|
||||
Standard_Real Um2;
|
||||
Standard_Real UM2;
|
||||
Standard_Real Vm2;
|
||||
Standard_Real VM2;
|
||||
Standard_Real ResoU1;
|
||||
Standard_Real ResoU2;
|
||||
Standard_Real ResoV1;
|
||||
Standard_Real ResoV2;
|
||||
Standard_Real pasInit[4]; // Should be constant while algorithm working
|
||||
Standard_Real myMaxParam[4]; //[0] = UM1, [1] = VM1, [2] = UM2, [3] = VM2
|
||||
Standard_Real myMinParam[4]; //[0] = Um1, [1] = Vm1, [2] = Um2, [3] = Vm2
|
||||
Standard_Real myReso[4]; //[0] = ResoU1, [1] = ResoV1, [2] = ResoU2, [3] = ResoV2
|
||||
Standard_Integer sensCheminement;
|
||||
IntImp_ConstIsoparametric choixIsoSav;
|
||||
IntSurf_PntOn2S previousPoint;
|
||||
@@ -239,10 +246,6 @@ private:
|
||||
gp_Dir2d firstd1;
|
||||
gp_Dir2d firstd2;
|
||||
IntWalk_TheInt2S myIntersectionOn2S;
|
||||
Standard_Integer STATIC_BLOCAGE_SUR_PAS_TROP_GRAND;
|
||||
Standard_Integer STATIC_PRECEDENT_INFLEXION;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -25,6 +25,12 @@ IntWalk_StepTooSmall,
|
||||
IntWalk_PointConfondu,
|
||||
IntWalk_ArretSurPointPrecedent,
|
||||
IntWalk_ArretSurPoint,
|
||||
IntWalk_IntersectsBoundary,
|
||||
IntWalk_IntersectPointNotFound,
|
||||
IntWalk_TooManyPoints,
|
||||
IntWalk_AnotherDirection,
|
||||
IntWalk_DirectionNotFound,
|
||||
IntWalk_ForcefulAdding,
|
||||
IntWalk_OK
|
||||
};
|
||||
|
||||
|
@@ -195,8 +195,9 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
|
||||
if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFF.Start();
|
||||
#endif
|
||||
|
||||
Standard_Real Deflection=0.01,MaxUV=0.01;
|
||||
Standard_Real Deflection=0.01;
|
||||
if (!myForceTolerances) {
|
||||
Standard_Real MaxUV;
|
||||
FTOL_FaceTolerances3d(B1,B2,myFace1,myFace2,S1,S2,
|
||||
myTol1,myTol2,Deflection,MaxUV);
|
||||
myTol1 = (myTol1 > 1.e-4)? 1.e-4: myTol1;
|
||||
@@ -211,11 +212,10 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
|
||||
if (TopOpeBRep_GettraceFITOL()) {
|
||||
cout<<"FacesIntersector : Perform tol1 = "<<tol1<<endl;
|
||||
cout<<" tol2 = "<<tol2<<endl;
|
||||
cout<<" defl = "<<Deflection<<" MaxUV = "<<MaxUV<<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
myIntersector.SetTolerances(myTol1,myTol2,MaxUV,Deflection);
|
||||
myIntersector.SetTolerances(myTol1,myTol2,Deflection);
|
||||
myIntersector.Perform(mySurface1,myDomain1,mySurface2,myDomain2,
|
||||
myTol1,myTol2,Standard_True,Standard_True,
|
||||
Standard_False);
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCCT ALL: Faulty shapes in variables faulty_1 to faulty_4"
|
||||
|
||||
# Original bug : fra60810
|
||||
# Date : 30mar98
|
||||
|
||||
@@ -7,3 +9,23 @@ restore [locate_data_file CTO900_fra60810-tool.rle] tool
|
||||
bcut result part tool
|
||||
checkprops result -s 30948.9
|
||||
checkview -display result -2d -s -otherwise { part tool } -path ${imagedir}/${test_image}.png
|
||||
|
||||
|
||||
############
|
||||
# This fragment should be deleted later.
|
||||
# It is used for regression explanation. Intersection result seems to be valid.
|
||||
|
||||
restore [locate_data_file CTO900_fra60810-part.rle] part
|
||||
restore [locate_data_file CTO900_fra60810-tool.rle] tool
|
||||
|
||||
explode part f
|
||||
explode tool f
|
||||
|
||||
donly part_9 part_10 part_23 part_24 tool_4 tool_13
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects part_9 part_10 part_23 part_24
|
||||
baddtools tool_4 tool_13
|
||||
bfillds
|
||||
bbop rr 4
|
||||
|
||||
|
@@ -4,5 +4,11 @@ explode m
|
||||
compound m_2 m_3 m_4 m_5 c1
|
||||
|
||||
bcut result m_1 c1
|
||||
|
||||
set log [bopargcheck result #F]
|
||||
if { [string compare -nocase $log "Shape(s) seem(s) to be valid for BOP.\n"] } {
|
||||
puts "ERROR. result is not valid for BOP"
|
||||
}
|
||||
|
||||
checkprops result -s 57618.4
|
||||
checkview -display result -2d -s -otherwise { m_1 c1 } -path ${imagedir}/${test_image}.png
|
||||
|
41
tests/bugs/modalg_6/bug23914
Normal file
41
tests/bugs/modalg_6/bug23914
Normal file
@@ -0,0 +1,41 @@
|
||||
puts "========"
|
||||
puts "OCC23914"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################
|
||||
# Intersection algorithm produced too many intersection points
|
||||
#################################
|
||||
|
||||
set max_time 0.05
|
||||
|
||||
bsplinesurf s1 1 2 0 2 1000 2 1 2 200 2 2000 2 100 300 200 1 400 300 200 1 100 300 500 1 400 300 500 1
|
||||
bsplinesurf s2 1 2 0 2 100 2 1 2 500 2 1000 2 100 200 400 1 500 200 400 1 100 600 400 1 500 600 400 1
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
intersect result s1 s2 -npp
|
||||
# Only one curve must be found
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
set chrono_info [dchrono cr show]
|
||||
regexp {CPU user time: ([-0-9.+eE]+) seconds} $chrono_info full CPU_time
|
||||
if { $CPU_time > ${max_time} } {
|
||||
puts "CPU user time of Boolean operation is more than ${max_time} seconds - Error"
|
||||
} else {
|
||||
puts "CPU user time of Boolean operation is less than ${max_time} seconds - OK"
|
||||
}
|
||||
|
||||
mkedge ee result
|
||||
checkprops ee -l 300
|
||||
|
||||
bounds result t1 t2
|
||||
xdistcs result s1 t1 t2 10 1.0e-7
|
||||
xdistcs result s2 t1 t2 10 1.0e-7
|
||||
|
||||
smallview
|
||||
donly s1 s2 result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
@@ -12,7 +12,7 @@ set U2 0.01131870392278708
|
||||
set V1 226.9760100729095
|
||||
set V2 203.7283534809051
|
||||
|
||||
intersect result su1 su2 $U1 $V1 $U2 $V2
|
||||
intersect result su1 su2 -sp $U1 $V1 $U2 $V2
|
||||
|
||||
set che [whatis result]
|
||||
|
||||
|
Reference in New Issue
Block a user