Archived issue #0031493
GCPnts_AbscissaPoint and CPnts_AbscissaPoint do not work properly for abscissa values larger than the curve length
Description
GCPnts_AbscissaPoint and CPnts_AbscissaPoint do not work properly for abscissa values larger than the curve length.
Lets call the parameter interval of the curve [c0, c1].
The curve seems to be extrapolated correctly for the abscissa calculation within a certain parameter range [p0, p1], with p0 < c0 < c1 < p1.
So [p0, p1] contains [c0, c1]. That means: The parameter range where the calculation works well is larger than the parameter range of the curve itself.
But outside this larger parameter range [p0, p] the calculation just does not work correctly any more.
Lets call the parameter interval of the curve [c0, c1].
The curve seems to be extrapolated correctly for the abscissa calculation within a certain parameter range [p0, p1], with p0 < c0 < c1 < p1.
So [p0, p1] contains [c0, c1]. That means: The parameter range where the calculation works well is larger than the parameter range of the curve itself.
But outside this larger parameter range [p0, p] the calculation just does not work correctly any more.
Steps to reproduce
TColgp_Array1OfPnt Poles(1, 3);
Poles.SetValue(1, gp_Pnt(0, 0, 0));
Poles.SetValue(2, gp_Pnt(1, 0, 0));
Poles.SetValue(3, gp_Pnt(2, 0, 0));
TColStd_Array1OfReal Knots(1, 2);
Knots.SetValue(1, 0);
Knots.SetValue(2, 1);
TColStd_Array1OfInteger Multis(1, 2);
Multis.SetValue(1, 3);
Multis.SetValue(2, 3);
const int Degree = 2;
const Handle(Geom_BSplineCurve) BSplineCurve = new Geom_BSplineCurve(Poles, Knots, Multis, Degree, false);
const GeomAdaptor_Curve AdaptorCurve(BSplineCurve);
// The abscissa values are larger than the curve length
const double Abscissa1 = 4;
const double Abscissa2 = 8;
const GCPnts_AbscissaPoint GC_Abscissa1(AdaptorCurve, Abscissa1, BSplineCurve->FirstParameter());
const GCPnts_AbscissaPoint GC_Abscissa2(AdaptorCurve, Abscissa2, BSplineCurve->FirstParameter());
const CPnts_AbscissaPoint C_Abscissa1(AdaptorCurve, Abscissa1, BSplineCurve->FirstParameter(), 0.001);
const CPnts_AbscissaPoint C_Abscissa2(AdaptorCurve, Abscissa2, BSplineCurve->FirstParameter(), 0.001);
// The parameters for the different abscissa values should not be equal.
// Actual they are equal for both computation methods: GCPnts_AbscissaPoint and CPnts_AbscissaPoint
const double GC_Dist1_Param = GC_Abscissa1.Parameter();
const double GC_Dist2_Param = GC_Abscissa2.Parameter();
const double C_Dist1_Param = C_Abscissa1.Parameter();
const double C_Dist2_Param = C_Abscissa2.Parameter();
Poles.SetValue(1, gp_Pnt(0, 0, 0));
Poles.SetValue(2, gp_Pnt(1, 0, 0));
Poles.SetValue(3, gp_Pnt(2, 0, 0));
TColStd_Array1OfReal Knots(1, 2);
Knots.SetValue(1, 0);
Knots.SetValue(2, 1);
TColStd_Array1OfInteger Multis(1, 2);
Multis.SetValue(1, 3);
Multis.SetValue(2, 3);
const int Degree = 2;
const Handle(Geom_BSplineCurve) BSplineCurve = new Geom_BSplineCurve(Poles, Knots, Multis, Degree, false);
const GeomAdaptor_Curve AdaptorCurve(BSplineCurve);
// The abscissa values are larger than the curve length
const double Abscissa1 = 4;
const double Abscissa2 = 8;
const GCPnts_AbscissaPoint GC_Abscissa1(AdaptorCurve, Abscissa1, BSplineCurve->FirstParameter());
const GCPnts_AbscissaPoint GC_Abscissa2(AdaptorCurve, Abscissa2, BSplineCurve->FirstParameter());
const CPnts_AbscissaPoint C_Abscissa1(AdaptorCurve, Abscissa1, BSplineCurve->FirstParameter(), 0.001);
const CPnts_AbscissaPoint C_Abscissa2(AdaptorCurve, Abscissa2, BSplineCurve->FirstParameter(), 0.001);
// The parameters for the different abscissa values should not be equal.
// Actual they are equal for both computation methods: GCPnts_AbscissaPoint and CPnts_AbscissaPoint
const double GC_Dist1_Param = GC_Abscissa1.Parameter();
const double GC_Dist2_Param = GC_Abscissa2.Parameter();
const double C_Dist1_Param = C_Abscissa1.Parameter();
const double C_Dist2_Param = C_Abscissa2.Parameter();
Public activity
No public notes
Participants are labeled by their role within this record.