RE: [Algorithms] Bezier curve fitting

 RE: [Algorithms] Bezier curve fitting From: Simon Fenney - 2005-10-14 09:56:39 ```Danny Kodicek wrote > In case anyone else is following this: >=20 > >The matrix for Catmull-Rom is >=20 > > 1/2 * [ -1 3 -1 1] > [ 2 -5 4 -1] > [-1 0 1 0] > [0 2 0 0] >=20 > I found what I guess was a typo here, and the first line=20 > should be [-1 3 -3 1]. >=20 > By my calculations (not yet tested) the translation matrix is > 1/6 [0 6 0 0] > [-1 6 1 0] > [0 1 6 -1] > [0 0 6 0] >=20 > This seems right, in that Bezier P0 maps to Catmull Q1 and P3=20 > to Q2 as expected. >=20 Oops - sorry. My rather feeble excuse was that I had a headcold so wasn't feeling the best. :( Simon ```

Thread view

 RE: [Algorithms] Bezier curve fitting From: Simon Fenney - 2005-10-13 12:26:19 ```Danny Kodicek wrote: >=20 > Alternatively (probably equivalently), how can I convert between a 2D=20 > Catmull-Rom spline and a Bezier curve?=20 That's easy enough. You use the matrix formulation for parametric = curves. If you have a cubic parametric curve of type A and want to = convert to type B, and Pa are the control points for A, then you need = the matrices for types A and B, Ma and Mb. You then apply Pb =3D Mb^-1 * Ma * Pa =20 The matrix for Catmull-Rom is 1/2 * [ -1 3 -1 1] [ 2 -5 4 -1] [-1 0 1 0] [0 2 0 0] and for Bezier (which you'll have to invert yourself) is=20 [-1 3 -3 1] [3 -6 3 0] [-3 3 0 0] [1 0 0 0] =20 Hope that helps. Simon ```
 RE: [Algorithms] Bezier curve fitting From: Willem de Boer - 2005-10-13 14:15:28 ```A quick test with Matlab reveals that the coordinate-transformation matrix is: 1/6 * [ 0 6 0 0 ] [-1 6 1 0 ] [ 0 1 6 -1] [ 0 0 6 0 ]. So yeah, Danny's calculations are correct. Cheers, --- Willem H. de Boer Homepage: http://www.whdeboer.com -----Original Message----- From: gdalgorithms-list-admin@... [mailto:gdalgorithms-list-admin@...] On Behalf Of Danny Kodicek Sent: 13 October 2005 14:58 To: gdalgorithms-list@... Subject: Re: [Algorithms] Bezier curve fitting In case anyone else is following this: >The matrix for Catmull-Rom is > 1/2 * [ -1 3 -1 1] [ 2 -5 4 -1] [-1 0 1 0] [0 2 0 0] I found what I guess was a typo here, and the first line should be [-1 3 -3=20 1]. By my calculations (not yet tested) the translation matrix is 1/6 [0 6 0 0] [-1 6 1 0] [0 1 6 -1] [0 0 6 0] This seems right, in that Bezier P0 maps to Catmull Q1 and P3 to Q2 as=20 expected. Danny=20 ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 ```
 RE: [Algorithms] Bezier curve fitting From: Simon Fenney - 2005-10-14 09:56:39 ```Danny Kodicek wrote > In case anyone else is following this: >=20 > >The matrix for Catmull-Rom is >=20 > > 1/2 * [ -1 3 -1 1] > [ 2 -5 4 -1] > [-1 0 1 0] > [0 2 0 0] >=20 > I found what I guess was a typo here, and the first line=20 > should be [-1 3 -3 1]. >=20 > By my calculations (not yet tested) the translation matrix is > 1/6 [0 6 0 0] > [-1 6 1 0] > [0 1 6 -1] > [0 0 6 0] >=20 > This seems right, in that Bezier P0 maps to Catmull Q1 and P3=20 > to Q2 as expected. >=20 Oops - sorry. My rather feeble excuse was that I had a headcold so wasn't feeling the best. :( Simon ```
 Re: [Algorithms] Bezier curve fitting From: Danny Kodicek - 2005-10-13 12:44:46 ```Danny Kodicek wrote: > > Alternatively (probably equivalently), how can I convert between a 2D > Catmull-Rom spline and a Bezier curve? >That's easy enough. You use the matrix formulation for parametric curves. >If you have a cubic parametric curve of type A and want to convert to type >B, and Pa are the control points for A, then you need the matrices for >types A and B, Ma and Mb. You then apply >Pb = Mb^-1 * Ma * Pa Doh - that makes sense. Thanks. Danny ```
 Re: [Algorithms] Bezier curve fitting From: Danny Kodicek - 2005-10-13 13:57:56 ```In case anyone else is following this: >The matrix for Catmull-Rom is > 1/2 * [ -1 3 -1 1] [ 2 -5 4 -1] [-1 0 1 0] [0 2 0 0] I found what I guess was a typo here, and the first line should be [-1 3 -3 1]. By my calculations (not yet tested) the translation matrix is 1/6 [0 6 0 0] [-1 6 1 0] [0 1 6 -1] [0 0 6 0] This seems right, in that Bezier P0 maps to Catmull Q1 and P3 to Q2 as expected. Danny ```

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks