1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024915: Wrong intersection curves between two cylinders

Existing method of Cylinder-Cylinder intersection computing is based on finding the analytic line (as a function of one argument) and converting one into the walking-line with set of equidistant (along the line parameter) points.

The main advantage of applied method is using adaptively computed step. Necessary step is computed into every point of the obtained walking-line. At that we receive final walking-line directly (without preliminary analytic line) and we determine moments more precisely, when it should be split (see IntPatch_ImpImpIntersection_4.gxx).

The main disadvantages is bad working this method for non-trimmed cylinders (with infinite bounds), because step value is depend on the boundaries values.

More over, new method always returns walking-line, while intersection result can be an analytic curve (lines, circle, ellipse). That is NO good. Therefore, analytic curve is computed by existing method.

In conclusion, in spite of covering almost all more often meeting cases, new method has limited application. Then we should use the existing old method.

Additionally, method MinMax() is added (see Standard_Real.hxx file). It uses into new algorithm.

Some test cases is changed according to their new behavior.

Test case for issue CR24915 is added.

Into GeometryTest_APICommands.cxx only tabulations were chaged.

"Extending" of isolines (see Geom2dHatch_Hatcher.cxx).

Small correction of test case for issue CR24915.
This commit is contained in:
nbv
2014-08-15 14:35:04 +04:00
committed by bugmaster
parent d15f387afa
commit ecc4f1489d
22 changed files with 2800 additions and 827 deletions

View File

@@ -49,12 +49,12 @@ Standard_IMPORT Draw_Viewer dout;
//=======================================================================
static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const char** a)
{
{
if ( n < 5)
{
{
cout << " Use proj curve/surf x y z [extrema algo: g(grad)/t(tree)]" << endl;
return 1;
}
}
gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
@@ -68,9 +68,9 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
aProjAlgo = Extrema_ExtAlgo_Tree;
if (GC.IsNull())
{
{
GS = DrawTrSurf::GetSurface(a[1]);
if (GS.IsNull())
return 1;
@@ -81,21 +81,21 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
Standard_Real UU,VV;
for ( Standard_Integer i = 1; i <= proj.NbPoints(); i++)
{
{
gp_Pnt P1 = proj.Point(i);
if ( P.Distance(P1) > Precision::Confusion())
{
{
Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P.Distance(P1));
Sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
}
}
else
{
Sprintf(name,"%s%d","ext_",i);
{
Sprintf(name,"%s%d","ext_",i);
di << name << " ";
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1);
@@ -103,47 +103,47 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
di << " Le point est sur la surface." << "\n";
di << " Ses parametres sont: UU = " << UU << "\n";
di << " VV = " << VV << "\n";
}
}
}
}
else
{
{
GeomAPI_ProjectPointOnCurve proj(P,GC,GC->FirstParameter(),
GC->LastParameter());
GC->LastParameter());
if(proj.NbPoints() == 0)
{
{
cout << "No project point was found." << endl;
return 0;
}
}
for ( Standard_Integer i = 1; i <= proj.NbPoints(); i++)
{
{
gp_Pnt P1 = proj.Point(i);
Standard_Real UU = proj.Parameter(i);
di << " parameter " << i << " = " << UU << "\n";
if ( P.Distance(P1) > Precision::Confusion())
{
{
Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P.Distance(P1));
Sprintf(name,"%s%d","ext_",i);
new Geom_TrimmedCurve(L, 0., P.Distance(P1));
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
}
}
else
{
Sprintf(name,"%s%d","ext_",i);
{
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1);
di << name << " ";
UU = proj.Parameter(i);
di << " Le point est sur la courbe." << "\n";
di << " Son parametre est U = " << UU << "\n";
}
}
}
}
return 0;
}