On 11-04-13 02:11, Alexander Brock wrote:
... I also formulated a target function for minimizing the distance between two curves and calculated the partial derivatives of this function. I'm pretty confident I will be able to use a gradient based method for finding the two control points which lead to minimal distance between the original curve and the new one.
Thoughts?
I see some issues with your maths, in particular that you seem to suggest integrating by arc-length, while the curves generally will not have the same length. In general, it is not that easy to get a natural correspondence between two parametric curves. However, don't let that stop you from experimenting. Feel free to come up with a proposal for how to do this, with some examples of the effect. (A patch would obviously be welcome if your suggestion is an improvement.)
One thing you might try to avoid needing a correspondence between positions on the curves is to look at the area between the curves, and see if you can find a decent approach of minimizing that. There should also be a fairly large amount of literature on approximating a sequence of points by a spline.
BTW, I would double-check what functionality lib2geom already has.