Getting the points of Geom2d_BSplineCurve

Hi,

I have been searching for how to get the points that are passed by the BSplineCurve. If for example, there is a value t(time). If t is zero, then the start point of the spline curve is returned, and if t is 1, then the end point of the spline curve is returned. If t is >0 and

Thank you.

For reference, this is my code to create the bspline curve:
//Prepare the points to be interpolated (passed)
Handle(TColgp_HArray1OfPnt2d) harray = new TColgp_HArray1OfPnt2d (1,MAIN_NUM_SPHERES); // sizing harray
for (int i=0;i {
harray->SetValue(i+1,gp_Pnt2d (g_vSpheresPos[i].x,g_vSpheresPos[i].y));

}

Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01);
anInterpolation.Perform();

Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve();

Rob Bachrach's picture

Well, assuming you just need points on the curve and not the original set of knot points, try using GeomLProp_CLProps2d and its Value function to get the location of a point at a parameter value on the curve. Use FirstParameter and LastParameter to get the start and end point parameters on the curve (as opposed to 0 and 1). You can also try using the D0 function on your Geom2D_BSplineCurve.

zaraasran's picture

Thank you for your reply, but I found only GeomLProp_CLProps in the documentation, and I could not find GeomLProp_CLProps2d. Did you mean GeomLProp_CLProps when you said GeomLProp_CLProps2d?
Then again, it seems FirstParameter and LastParameter functions don`t exist in GeomLProp_CLProps class.

Thank you,

Sindharta

zaraasran's picture

Thank you very much. I used the D0 function and it works. Thanks again.

Sindharta

Stephane Routelous's picture

you may have a look at the GCPnts package.

HTH,

Stephane
http://www.exotk.org

zaraasran's picture

I have seen the package you suggested too. I didn`t know there are such functions and I am sure it will be very useful.
Thank you very much.