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

0023706: Cannot project point on curve

1.   Approximation of derivative (by Taylor-series and by three points).
2.   Some methods (Degree(), GetType(), D0(), D3(), DN()) are added.
3.   Getting of subInterval's boundaries.
4.   Algorithm for checking if 1st derivative is equal to zero is amended.
5.   Cases are controlled when extrema or Project point do not exist.
6.   GetNormal() function for gp_Vec2d was added.
7.   Computing of Value, D0, D1, D2 and D3 for offset curves was changed.
8.   Limitation of tolerance for derivative computing was added.
9.   Methods for computing trihedron in singularity point are added.
10. Test tests/bugs/moddata_3/bug23706 is added.
11. Restriction on the LastParameter for visualization of 3-D curves. Calling PlotCurve(...) function for last interval.
12. LProp package is modified for tangent computing in singularity point (LProp_CLProps, LProp_SLProps).
13. Added test cases for issue.
Deleting bad test cases for this fix
This commit is contained in:
nbv
2013-06-13 15:12:06 +04:00
parent 71797c62f1
commit 32ca7a5106
93 changed files with 4498 additions and 1203 deletions

View File

@@ -127,21 +127,25 @@ static void PlotCurve (Draw_Display& aDisplay,
//=======================================================================
void DrawTrSurf_Drawable::DrawCurveOn (Adaptor3d_Curve& C,
Draw_Display& aDisplay) const
Draw_Display& aDisplay) const
{
gp_Pnt P;
if (myDrawMode == 1) {
if (myDrawMode == 1)
{
Standard_Real Fleche = myDeflection/aDisplay.Zoom();
GCPnts_UniformDeflection LineVu(C,Fleche);
if (LineVu.IsDone()) {
if (LineVu.IsDone())
{
aDisplay.MoveTo(LineVu.Value(1));
for (Standard_Integer i = 2; i <= LineVu.NbPoints(); i++) {
aDisplay.DrawTo(LineVu.Value(i));
for (Standard_Integer i = 2; i <= LineVu.NbPoints(); i++)
{
aDisplay.DrawTo(LineVu.Value(i));
}
}
}
}
else {
Standard_Real j;
else
{
Standard_Integer j;
Standard_Integer intrv, nbintv = C.NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1,nbintv+1);
C.Intervals(TI,GeomAbs_CN);
@@ -150,36 +154,44 @@ void DrawTrSurf_Drawable::DrawCurveOn (Adaptor3d_Curve& C,
GeomAbs_CurveType CurvType = C.GetType();
gp_Pnt aPPnt=P, aNPnt;
for (intrv = 1; intrv <= nbintv; intrv++) {
for (intrv = 1; intrv <= nbintv; intrv++)
{
Standard_Real t = TI(intrv);
Standard_Real step = (TI(intrv+1) - t) / myDiscret;
switch (CurvType) {
case GeomAbs_Line :
break;
case GeomAbs_Circle :
case GeomAbs_Ellipse :
for (j = 1; j < myDiscret; j++) {
t += step;
C.D0(t,P);
aDisplay.DrawTo(P);
}
break;
case GeomAbs_Parabola :
case GeomAbs_Hyperbola :
case GeomAbs_BezierCurve :
case GeomAbs_BSplineCurve :
case GeomAbs_OtherCurve :
for (j = 1; j <= myDiscret/2; j++) {
C.D0 (t+step*2., aNPnt);
switch (CurvType)
{
case GeomAbs_Line:
break;
case GeomAbs_Circle:
case GeomAbs_Ellipse:
for (j = 1; j < myDiscret; j++)
{
t += step;
C.D0(t,P);
aDisplay.DrawTo(P);
}
break;
case GeomAbs_Parabola:
case GeomAbs_Hyperbola:
case GeomAbs_BezierCurve:
case GeomAbs_BSplineCurve:
case GeomAbs_OtherCurve:
const Standard_Integer nIter = myDiscret/2;
for (j = 1; j < nIter; j++)
{
const Standard_Real t1 = t+step*2.;
C.D0 (t1, aNPnt);
PlotCurve (aDisplay, C, t, step, aPPnt, aNPnt);
aPPnt = aNPnt;
t += step*2.;
}
break;
aPPnt = aNPnt;
t = t1;
}
break;
}
C.D0(TI(intrv+1),P);
PlotCurve (aDisplay, C, t, step, aPPnt, P);
aDisplay.DrawTo(P);
}
}