Spline parameters and poles

Hi all,

is there a way to tell the "parameter" for a specific pole (that is a gp_Pnt) for a BSplineCurve ?

You can get the forst/last parameter (whatever it is) for your BSplineCurve via Geom_BSplineCurve::FirstParameter(); and Geom_BSplineCurve::LastParameter();

But now, I seek the "Parameter" for a specific point somewhere on the BSplineCurve, so that this "Parameter" lies between the FirstParameter/LastParameter.

Any hints ?

Mike

Jeanmi B's picture

Hello,

Use GeomAPI_ProjectPointOnCurve::GeomAPI_ProjectPointOnCurve(const gp_Pnt& P,
const Handle(Geom_Curve)& Curve,
const Standard_Real Umin,
const Standard_Real Usup)

Look documented class in corresponding .cdl file or online docs

Regards

Jean Michel

e3dfx's picture

Thanks, I think this is a good hint.

But are you sure, that the parameter per point returned here has the same meaning as the parameter bounded by Geom_BSplineCurve::FirstParameter() and Geom_BSplineCurve::LastParameter() ?

Anyway, what is the meaning of those suspect "parameters" ?
Maybe that there is a methematical way to compute them via knots or multipliers or whatever ?

The best thing would be a Geom_BSplineCurve class-method returning the parameter for a specific point on the BSplineCurve.

Can anyone clarify this ? What is the differenc between all that parameters ??????

Best Regards.

Mike

Jeanmi B's picture

Hello Mike,

1/ Geom_BSplineCurve::FirstParameter() and Geom_BSplineCurve::LastParameter() corresponds to the range definition of the curve. Most often curves (like Bezier) are defined betwwen 0 and 1 but for general cases this is not always the case.

2/ The umin and usup arguments of the constructor of GeomAPI_ProjectPointOnCurve are just hints for the projection algorithm to restrict the number of solutions between umin and usup

3/ the main drawback of parametric curves (this is also right for parametric surfaces) is that in general there is no analytic way to get the parameter of a given point on a curve. That's why we use a projection algorithm.

Above explanations may seem obvious but I tried to clarify.

Regards.

Jean Michel

e3dfx's picture

Thank you again.
Most recently, I read Geom_BSplineCurve.cdl, that the FirstParameter and the LastParameter are knot-values. Maybe I just need the knot-value for a gp_Pnt from the BSplineCurve.
Why do I ask for all that stuff ?

Because: Using Geom_BSplineCurve::Segment( Standard_Real U1, Standard_Real U2), I can receive the "smaller" part of my BSplineCurve finally.

The funny thing is, when I use GeomAPI_ProjectPointOnCurve::GeomAPI_ProjectPointOnCurve(gp_Pnt, Handle(Geom_Curve) & Curve, double Umin, double Usup) with Umin=FirstParameter from Geom_BSPlineCurve and Usup=LastParameter from Geom_BSPlineCurve and try to receive the
GeomAPI_ProjectPointOnCurve::Parameter(), it does not match the FirstParameter/LastParameter in the start and endpoints.

The point I projected on the curve, already lies on that curve. I just projected in order to get the parameter. This is correct ? Or shall I move the point away a little bit ???

Regards
Mike