Drawing a clamped uniform cubic B-spline using Cairo

Posted by Tamás on Stack Overflow See other posts from Stack Overflow or by Tamás
Published on 2010-03-28T22:13:24Z Indexed on 2010/03/29 0:13 UTC
Read the original article Hit count: 892

Filed under:
|
|
|
|

I have a bunch of coordinates which are the control points of a clamped uniform cubic B-spline on the 2D plane. I would like to draw this curve using Cairo calls (in Python, using Cairo's Python bindings), but as far as I know, Cairo supports Bézier curves only. I also know that the segments of a B-spline between two control points can be drawn using Bézier curves, but I can't find the exact formulae anywhere. Given the coordinates of the control points, how can I derive the control points of the corresponding Bézier curves? Is there any efficient algorithm for that?

© Stack Overflow or respective owner

Related posts about cairo

Related posts about pycairo