Bézier curve fitting with SciPy

后端 未结 7 619
醉酒成梦
醉酒成梦 2020-12-04 19:57

I have a set of points which approximate a 2D curve. I would like to use Python with numpy and scipy to find a cubic Bézier path which approximately fits the points, where I

7条回答
  •  春和景丽
    2020-12-04 20:35

    A Bezier curve isn't guaranteed to pass through every point you supply it with; control points are arbitrary (in the sense that there is no specific algorithm for finding them, you simply choose them yourself) and only pull the curve in a direction.

    If you want a curve which will pass through every point you supply it with, you need something like a natural cubic spline, and due to the limitations of those (you must supply them with increasing x co-ordinates, or it tends to infinity), you'll probably want a parametric natural cubic spline.

    There are nice tutorials here:

    Cubic Splines

    Parametric Cubic Splines

提交回复
热议问题