Add support for Quadratic Beziers

Bug #1009765 reported by Shriramana Sharma on 2012-06-06
This bug affects 2 people
Affects Status Importance Assigned to Milestone

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:

But it seems ( that adding support for quadratic Beziers is not all that difficult, since all you need to do is to glue two cubic handles together as Krzysztof remarked on that thread. Apparently the only confusion (mentioned in the UI thread) is about how to provide support for elliptic segments.

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: would show how quadratic editing capabilities would be tremendously useful especially in font creation!

su_v (suv-lp) on 2012-06-07
tags: added: node-editing svg
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Shriramana Sharma (jamadagni) wrote :

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 ( 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 but the relevant version for the present situation is given by:

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

Shriramana Sharma (jamadagni) wrote :

So I did some more digging:

1. Apparently a quadratic can't be substituted by a cubic where both cubic controls are set equal to the single quadratic one, or one cubic control is set equal to a node and the other is set equal to the quadratic control. Only the 2/3 formula will work. See attached images. (

2. FWIW I submitted some simple patches for Cairo to support quadratics:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers