views:

576

answers:

2

I have a sequential collection of points in X,Y and I'd like to "trace" these into a set of bezier curves. Could any open source bitmap to vector tracing algorithm or library be used for this?

+1  A: 

You want to use piece-wise b-spline curves rather than beziers if you want the curve to pass through an existing set of points.

There's tons of code on the web for doing this.

U62
+3  A: 

This depends on what you want to accomplish. If you want to see the 'best fit' curve, or at least a rough approximation, you should use a b_spline. A b_spline will fit itself 'inside' the points it is given. For going through the points in question I would generally use a Catmull-Rom spline which, when given points 1,2,3 will pass through point 2 with slope equal to the slope between points 1 & 3.

Sample Code: http://willperone.net/Code/spline.php

Explanation of the algorithm: http://steve.hollasch.net/cgindex/curves/catmull-rom.html

Thomas