BezierInfo-2 icon indicating copy to clipboard operation
BezierInfo-2 copied to clipboard

Curve Fitting Improvement

Open tahsina13 opened this issue 6 years ago • 3 comments

Hey Pomax thanks for the awesome book about Bezier curves. Recently I've been looking into curve fitting for a project and I think that I've found a paper that talks about some improvements to your method. In section 4 of their paper, Plass and Stone talk about a better way of estimating the t values of each of the sample points. He suggests that you should initially guess t values based on distance similar to what you are doing, but after getting the fitted Bezier curve for each of the sampled points you should find the point closest to it on the Bezier curve. Then set the new t value to the t of that point on the Bezier. They suggest using the newton-raphson method to find the min of the distance between the point and the function.
I think that this is a relatively simple improvement worth including in your site. I tried it out for myself and I got pretty good results. 0 4 Also you might want to add a section about poly fitting because usually one Bezier curve is not enough to accurately fit the data. That's why you need to find knots and split it into picewise Bezier curve. I'm still looking into this, so idk how to do any of that.

tahsina13 avatar Apr 14 '20 13:04 tahsina13

The problem with poly fitting is that your curve should not fit your data, it should be appropriate to the underlying model that yielded your data; switching from a single curve with all the restrictions that entails, to a a polycurve that can literally pass through every single point in a ludicrous-but-it-is-a-perfect-fit way is both bad science and bad programming =)

Having said that, it would be nice to mention the additional iteration, with a link to that paper. Hopefully I have some time soon to extend the section with that, thank you!

Pomax avatar Jun 09 '20 15:06 Pomax

Hey would it be ok if I work on this? It's summer break and I don't really have much to do. I don't really know too much about web dev so it might take me a while.

tahsina13 avatar Jul 11 '20 04:07 tahsina13

If you're still interested in that: absolutely, as long as the approach isn't license-encumbered =)

Pomax avatar Jul 28 '20 16:07 Pomax