[cairo] [off topic?] SVG question elliptical arc question

Andrea Canciani ranma42 at gmail.com
Mon Nov 9 11:10:52 PST 2009


On Mon, Nov 9, 2009 at 7:49 PM, Travis Griggs <tgriggs at cincom.com> wrote:
> I am trying to render the SVG 'a' (elliptical arc) path command in
> Cairo using just the arc drawing APIs and various transforms. One
> question has come up as I work through it though.
>
> Assuming that the two endpoints of the arc and the x_axis_rotation
> jive such that the arc is normal to the vector between the two end
> points, what happens if the rx value (x radius) is less than half of
> the distance between the two points? The svg spec example does just
> that, sets an rx of 25, but the distance between the two points is
> ~56. So this begs the question of what to do? If the rx is half the
> distance, then the center of the ellipse lies along the vector. If rx
> is big, then it is off axis, making room for a bigger ellipse that
> includes the two points. But I don't know what the right way to
> proceed for the less than case is.
Based on "F.6.2 Out-of-range parameters" from the appendix F of the
SVG 1.1 standard
(http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters) I
would say that rx (and ry) are scaled until there is exactly one
solution.
Andrea Canciani


More information about the cairo mailing list