[off topic?] SVG question elliptical arc question

View: New views
2 Messages — Rating Filter:   Alert me  

[off topic?] SVG question elliptical arc question

by Travis Griggs-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

TIA

--
Travis Griggs
Objologist
One man's blue plane is another man's pink plane.


_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: [off topic?] SVG question elliptical arc question

by Andrea Canciani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 7:49 PM, Travis Griggs <tgriggs@...> 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
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo