mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
Line-Plane extrema has been added in analytical case.
This commit is contained in:
@@ -123,7 +123,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
|
|||||||
break;
|
break;
|
||||||
case GeomAbs_Plane:
|
case GeomAbs_Plane:
|
||||||
myExtElCS.Perform(C.Line(), myS->Plane());
|
myExtElCS.Perform(C.Line(), myS->Plane());
|
||||||
if (myExtElCS.IsParallel()) break;
|
if (myExtElCS.IsParallel() || myExtElCS.NbExt() > 0) break;
|
||||||
|
|
||||||
case GeomAbs_Torus:
|
case GeomAbs_Torus:
|
||||||
case GeomAbs_Cone:
|
case GeomAbs_Cone:
|
||||||
|
@@ -56,10 +56,39 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C,
|
|||||||
mySqDist->SetValue(1, S.SquareDistance(C));
|
mySqDist->SetValue(1, S.SquareDistance(C));
|
||||||
myIsPar = Standard_True;
|
myIsPar = Standard_True;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
myNbExt = 0;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -40,12 +40,12 @@ is
|
|||||||
---C++: inline
|
---C++: inline
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
Parameter (me : mutable; theU, theV: Real from Standard; theP : Pnt from gp)
|
SetParameters(me: in out;
|
||||||
|
theU, theV: Real from Standard;
|
||||||
|
thePnt: Pnt from gp);
|
||||||
---Purpose: Sets the params of current POnSurf instance.
|
---Purpose: Sets the params of current POnSurf instance.
|
||||||
-- (e.g. to the point to be projected).
|
-- (e.g. to the point to be projected).
|
||||||
---C++: inline
|
---C++: inline
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
fields
|
fields
|
||||||
myU: Real;
|
myU: Real;
|
||||||
|
@@ -420,7 +420,11 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
|
|||||||
{
|
{
|
||||||
gp_Pnt P1,P2;
|
gp_Pnt P1,P2;
|
||||||
Ex.Points(i,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_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
|
||||||
Handle(Geom_TrimmedCurve) CT =
|
Handle(Geom_TrimmedCurve) CT =
|
||||||
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
|
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;
|
gp_Pnt P1,P2;
|
||||||
Ex.Points(i,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_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
|
||||||
Handle(Geom_TrimmedCurve) CT =
|
Handle(Geom_TrimmedCurve) CT =
|
||||||
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
|
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;
|
gp_Pnt P1,P2;
|
||||||
Ex.Points(i,P1,P2);
|
Ex.Points(i,P1,P2);
|
||||||
if (P1.Distance(P2) < 1.e-16)
|
if (P1.Distance(P2) < 1.e-16)
|
||||||
|
{
|
||||||
|
di << "Extrema " << i << " is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
|
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
|
||||||
Handle(Geom_TrimmedCurve) CT =
|
Handle(Geom_TrimmedCurve) CT =
|
||||||
|
@@ -30,10 +30,3 @@ checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
|
|||||||
dlog reset
|
dlog reset
|
||||||
dlog on
|
dlog on
|
||||||
xdistcs c s 3.140212946671221 3.142972360508366 10
|
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}
|
|
||||||
|
@@ -19,13 +19,4 @@ set tol_abs 1.0e-6
|
|||||||
set tol_rel 1.0e-6
|
set tol_rel 1.0e-6
|
||||||
checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
|
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
|
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}
|
|
||||||
|
Reference in New Issue
Block a user