We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm looking for a library that will allow the user to "draw" curves, by add/removing vertexes and dragging control points on the screen. Something similar to the pen tools in Photoshop, Illustrator, or Inkscape. Ideally, where each vertex can be toggled between smooth and sharp (whether the control points are always on a line passing between them and the vertex).
In 2d; there's no real need for 3d. The final product will be an Android app.
These curves will be used to generate color ramps, so they will never bend back over themselves. They will primarily run on the X axis, so I also need a way to calculate the Y value at any point on the curve (Y values will get mapped to a range from 0 to 255).
I'll need a way to save the curves, perhaps as a simple SVG file.
I looked at most of the graphics related libraries, but didn't see one that seemed to fit my needs. Is there one I missed?
Answers
Hi Dracos,
Processing includes functions to draw Bezier curves: http://www.processing.org/reference/bezier_.html
For SVG export and more advanced vector graphics, you can have a look at the Geomerative library: http://www.ricardmarxer.com/geomerative/
Bezier is for single curves, I'm looking for a library that can manage one or more curve segments chained together as a logical unit.
Unless I'm misunderstanding,
bezierVertex()
should do that (although you may have to write the 'logical unit' part).