|
From: Jae-Joon L. <lee...@gm...> - 2010-01-14 18:18:31
|
On Thu, Jan 14, 2010 at 4:38 AM, Mark Bakker <ma...@gm...> wrote: > Does matplotlib have a routine that can fit a cubic Bezier curve through an > array of 2D points? > > I saw some Bezier routines in Path, but couldn't find what I am looking for. > As far as I know, no. > If matplotlib doesn't have it, does anybody have another suggestion in > Python? > The attached is what I have used once. It uses scipy.interpolate.splprep to fit the input as a B-spline then convert it to cubic bezier curve. But I have no idea if this is the best way to do it. The original code is from http://mail.scipy.org/pipermail/scipy-dev/2007-February/006651.html And I only added some mpl-related things. Regards, -JJ |