Re: Drawing Arcs
Re: Drawing Arcs
- Subject: Re: Drawing Arcs
- From: "Alastair J.Houghton" <email@hidden>
- Date: Sun, 6 Jul 2003 22:05:24 +0100
On Sunday, July 6, 2003, at 08:14 pm, Henry McGilton wrote:
* * I notice that NSBezierPath can draw arcs that trace
* * along a circle, but not elliptical arcs. What's
* * the best approach for tackling this?
Sorry, I notice that NSBezierPath *can* draw arcs that trace along
elliptical arcs.
No, it can't (apart from a complete ellipse and the degenerate case of
the two radii being the same), which is why the question was asked in
the first place. But as you say you can use an NSAffineTransform to
get what you're after.
So any time you see somebody writing about using Bezier curve
operators to approximate arcs, you can be sure they have overlooked
the obvious.
Indeed. Guilty as charged ;->. Actually I should have known that this
was possible, because I'd been fooling around with the segment data
from NSBezierPath objects a while back.
But, you get the desired effect (uniformly rendered attributes in
a transformed coordinate system) by using NSAffineTransform's
transformBezierPath method, which appears ready-made for just this
application.
I already sent a code sample to the list that does what is needed. Not
sure why it hasn't arrived already.
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.