I'm dealing with a problem to approximate some data points with B-Spline. I follow the method and implemented the algorithm from this site: Curve Global Approximation.

1) The first step is to calculate the control points from the given data points and spline degree. Knot vector is uniformly and ranges [0,1]. (e.g. a 3 degree Bspline with 6 control points has the knot vector [0, 0, 0, 0, 0.33333, 0.66667, 1, 1, 1, 1]) The parameter selection is based on the "Centripetal Method".

2) After obtaining the control points, I plotted the spline to see how the number of control points can affect the approximation. However, when the number of control points increases, the spline deviates a lot from the original polyline. But based on the results from the above link, it should produce a more accurate Bspline? or ??

3)How can I improve the approximation?

I'm not allowed to paste a figure yet, so here is the link to the figure A degree 4 B-Spline curve with different number of control Points

enter image description here

Thx for the help =)


The calculated control Points seem to locate far away from the Spline and original polylines. Should all control points always close to the original polylines?

Here is the figure with plotted control points and Bspline enter image description here


In B-spline fitting (interpolation or approximation), we should typically compute knot vector from parameters assigned to each point. This is specially important for interpolation cases as not doing so will easily violate the Schoenberg-Whitney condition and lead to ill-conditioned matrix.

For approximation cases, typically there are many more points than the number of control points you would like to fit with and the S-W condition will always be satisfied. However, when you have relatively few data points (such as in your case) and the number of control points is approaching the number of data points (which means that it is getting closer to the interpolation case), then the S-W condition will become important again. This would explain why the curve deviates more with more control points.

So, I would suggest to compute knot vector based on parameters, instead of always using uniform knot vector.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.