Comment 1 for bug 1009765

Revision history for this message
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 (http://www.cairographics.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>