1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Line-Plane extrema has been added in analytical case.

This commit is contained in:
nbv
2016-07-15 15:56:21 +03:00
parent 2a56652429
commit d6e98f99a7
6 changed files with 52 additions and 28 deletions

View File

@@ -123,7 +123,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
break;
case GeomAbs_Plane:
myExtElCS.Perform(C.Line(), myS->Plane());
if (myExtElCS.IsParallel()) break;
if (myExtElCS.IsParallel() || myExtElCS.NbExt() > 0) break;
case GeomAbs_Torus:
case GeomAbs_Cone:

View File

@@ -56,10 +56,39 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C,
mySqDist->SetValue(1, S.SquareDistance(C));
myIsPar = Standard_True;
}
else {
else
{
myNbExt = 0;
}
IntAna_IntConicQuad anInter(C, S,
Precision::Angular(),
Precision::Confusion());
if(anInter.IsDone())
{
myNbExt = anInter.NbPoints();
}
if(myNbExt == 0)
return;
myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
Standard_Real aUSurf = 0.0, aVSurf = 0.0;
Extrema_POnCurv aPOnC;
Extrema_POnSurf aPOnS;
const gp_Pnt& aPC = anInter.Point(1);
aPOnC.SetValues(anInter.ParamOnConic(1), aPC);
myPoint1->SetValue(1, aPOnC);
ElSLib::PlaneParameters(S.Position(), aPC, aUSurf, aVSurf);
const gp_Pnt aPS(ElSLib::PlaneValue(aUSurf, aVSurf, S.Position()));
aPOnS.SetParameters(aUSurf, aVSurf, aPS);
myPoint2->SetValue(1, aPOnS);
mySqDist->SetValue(1, 0.0);
}
}

View File

@@ -40,12 +40,12 @@ is
---C++: inline
is static;
Parameter (me : mutable; theU, theV: Real from Standard; theP : Pnt from gp)
---Purpose: Sets the params of current POnSurf instance.
-- (e.g. to the point to be projected).
---C++: inline
is static;
SetParameters(me: in out;
theU, theV: Real from Standard;
thePnt: Pnt from gp);
---Purpose: Sets the params of current POnSurf instance.
-- (e.g. to the point to be projected).
---C++: inline
fields
myU: Real;

View File

@@ -420,7 +420,11 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
{
gp_Pnt P1,P2;
Ex.Points(i,P1,P2);
if (P1.Distance(P2) < 1.e-16) continue;
if (P1.Distance(P2) < 1.e-16)
{
di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
continue;
}
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@@ -446,7 +450,11 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
{
gp_Pnt P1,P2;
Ex.Points(i,P1,P2);
if (P1.Distance(P2) < 1.e-16) continue;
if (P1.Distance(P2) < 1.e-16)
{
di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
continue;
}
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@@ -473,7 +481,10 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
gp_Pnt P1,P2;
Ex.Points(i,P1,P2);
if (P1.Distance(P2) < 1.e-16)
{
di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
continue;
}
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =

View File

@@ -30,10 +30,3 @@ checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
dlog reset
dlog on
xdistcs c s 3.140212946671221 3.142972360508366 10
set Log [dlog get]
set List [split ${Log} {TD= \t\n}]
set Tolerance 1.0e-6
set D_good 0.
set Limit_Tol 1.0e-6
checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol}

View File

@@ -19,13 +19,4 @@ set tol_abs 1.0e-6
set tol_rel 1.0e-6
checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
dlog reset
dlog on
xdistcs c s 1.57079 1.5708 10
set Log [dlog get]
set List [split ${Log} {TD= \t\n}]
set Tolerance 1.0e-6
set D_good 0.
set Limit_Tol 1.0e-6
checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol}