Re: NSBezierPath clockwise?
Re: NSBezierPath clockwise?
- Subject: Re: NSBezierPath clockwise?
- From: Gregory Weston <email@hidden>
- Date: Sat, 15 Oct 2005 11:45:04 -0400
On Oct 15, 2005, at 9:05 AM, Lorenzo wrote:
Hi,
I have to detect whether a bezier path describing a polygon, is
clockwise or
anti-clockwise. For closed filled shapes non concave, as a circle,
is pretty
easy. I get the center of the shape, then I check the first 2
points of the
path. If they create a positive angle with the center, well, it's
anti-clockwise.
...
My rough idea is:
a) I get a direction comparing 3 points of the curve. e.g. It's
clowise.
b) Then if at the right of each point I don't find the filled
area of
the polygon, I have to invert the direction thus it's anti-
clockwise.
Could this method work in any case?
Any suggestion?
I'm not sure about others, but I'm having the impression that this is
one of those questions that's best-answered by the question "What are
you really trying to accomplish?" As in, what's the goal of
determining whether a path goes "clockwise?"
G
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden