Add support for Quadratic Beziers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Inkscape currently supports Cubic Beziers. Quadratic Bezier curves are also an integral part of the SVG specification. It would be simply great if Inkscape would help us edit quadratic Beziers.
I am told that currently Inkscape can read quadratic Beziers from SVG files but it elevates them to cubic. It seems that this is a lossy conversion in the sense that the quadratic nature of that curve is not and one is allowed to edit the two generated control points mutually independently, and hence while saving back, (whether the generated control points were modified or not) the original quadratic nature is lost and the curve is henceforth a cubic.
I feel it is important that Inkscape should provide native support for quadratic Beziers. Rendering it on screen for editing purposes would not be a problem, since even if you only do cubic rendering using Cairo or such, you can always temporarily elevate the quadratic to cubic for rendering purposes. But there should be a quadratic mode for the Bezier drawing tool, which would only allow for specifying one control point per curve segment.
I realize that there has been a recent discussion of this on the devel list: http://
But it seems (http://
But obviously it is not necessary to wait for the elliptic question to be resolved for the quadratic feature to be provided. Quadratic editing capabilities would be a great boon for users with specific requirements like me! I hope this link: http://
tags: | added: node-editing svg |
Changed in inkscape: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Hello. I've been investigating this and it seems that one should not simply join the cubic's control points together. Since Cairo (IIRC Inkscape from the current development onwards uses Cairo) does not have a built-in function to draw quadratic curves (http:// www.cairographi cs.org/ manual/ cairo-Paths. html) the behind-the-scenes cubic control point pair equivalent to a single quadratic control point have to be calculated by degree-elevation.
The generic formula is available at http:// en.wikipedia. org/wiki/ B%C3%A9zier_ curve#Degree_ elevation but the relevant version for the present situation is given by: http:// caffeineowl. com/graphics/ 2d/vectorial/ cubic2quad01. html
<quote>
A quadratic Bezier can be always represented by a cubic one by applying the degree elevation algorithm. The resulted cubic representation will share its anchor points with the original quadratic, while the control points will be at 2/3 of the quadratic handle segments:
C1 = (2·C + P1)/3
C2 = (2·C + P2)/3
</quote>