# approximate a curve using splines

This topic is 3815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello everyone, I am currently facing a problem where I need to come up with a function that passes through a given set of points. So, I have the data points and I need to fit a spline with minimum number of control points that maintains the shape with a given error tolerance. I guess I am looking for approximating splines that will give the given shape. However, I have no idea on where to even start. I looked at a book which talks about wavelet decomposition of the splines to lower dimensions but I could not follow the mathematics. Does anyone have any idea on how one can go about it? I would be really grateful. I need to code something up quite fast and need your help! Thanks, xarg

##### Share on other sites
I believe Dave Eberly's 3D Game Engine Design book has this information - and perhaps more importantly to you a free downloadable source implementation at: www.geometrictools.com

The book is worth it's weight in gold, so I would highly recommend it!

##### Share on other sites
Cool! I will try and look it up! Would you happen to have a copy of the book and know which chapter to focus on?

xarg

##### Share on other sites
Also check out: Game Programming Gems 4.
Section: 2.4 Nonuniform Splines by Thomas Lowe

Since you're going through points (not just near them), you'll want to pick one of the following:

Catmull-Rom
Natural cubic
Rounded nonuniform
Smooth nonuniform

##### Share on other sites
The TI83 can do this in two dimensions, adding a third shouldn't be too bad :)

https://nrich.maths.org/discus/messages/67613/70220.html?1152646145

##### Share on other sites
Hello everyone,

This is another question about using splines to approximate curves.

I have now gone through the relevant chapters in Dave Eberly's book and have a decent idea on how to make it work with the B-splines

So, the B-splines are given as:

X(u) = summation[i=0...n] N(i, d) Q(i)

So, the nice thing about the B-splines is that it can be broken down as the linear combination of these knot vectors with the control points. So, I can now arbitrarily choose however number of control points and try to do a least square fit with my given surface. The process is calculating the above quantity for the sample time u.

Now, what I want to know is whether such a basis exists for a Catmull Rom Spline as well. Can I do the same thing with a catmull-rom spline where given the degree and the number of control points that I wish to use, I am able to do express the evaluation function as above. Since, I am approximating a surface, I would like to decide how many control points I want to use and somehow express the evaluation function in terms of some basis function and this control point vector.

So, basically it boils down to use Catmull Rom splines as an approximating spline rather than an interpolating one.

I would really appreciate your help.

Cheers,
xarg

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 12
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013545
×