views:

247

answers:

2

Hi,
Is there a library of data structures and operations for quadratic bezier curves? I need to implement:

  • bezier to bitmap converting with arbitrary quality
  • optimizing bezier curves
  • common operations like subtraction, extraction, rendering etc.

languages: c,c++,.net,python
Algorithms without implementation (pseudocode or etc) could be useful too. (especially optimization)

+1  A: 

You might want to take a look at Cairo. I am not exactly sure if it covers all your requirements but it should be able to handle rendering at least.

bebraw
thanx. could i use carrio in .net ?
Sorush Rabiee
Cairo is closely related to GTK, and the Mono project has an assembly for it: http://www.mono-project.com/Mono.Cairo
SamB
+2  A: 

A little bit of python lib is included in nodebox:

http://nodebox.net/code/index.php/Bezier

There are plenty of algorithms inside inkscape, but I did not digg the code yet to find, how easy they could be used outside if inkscape.

Update: Inkscape is using lib2geom:

lib2geom (2Geom in private life) was initially a library developed for Inkscape but will provide a robust computational geometry framework for any application. It is not a rendering library, instead concentrating on high level algorithms such as computing arc length.

lib2geom is at lib2geom.sourceforge.net

Unfortunately I do not have enough karma to add the link...

toka
Thanks for lib2geom.
Sorush Rabiee