• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBezierPath clockwise?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBezierPath clockwise?


  • Subject: NSBezierPath clockwise?
  • From: Lorenzo <email@hidden>
  • Date: Sat, 15 Oct 2005 13:52:53 +0200

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.

For closed filled shapes with some concavity/convexity, (think about the
character "C" with a bold style) it's not so easy. The first point of the
path could be in the interior area of the C, and go anti-clockwise. But if
you follow that path, once you go on the top of the C you discover it is
clockWise. I suppose I have to detect the direction looking at the filled
area. My raugh 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?


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
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

  • Prev by Date: Programmatically selecting a cell in a NSBrowser
  • Next by Date: Re: Programmatically selecting a cell in a NSBrowser
  • Previous by thread: Re: Programmatically selecting a cell in a NSBrowser
  • Next by thread: Re: NSBezierPath clockwise?
  • Index(es):
    • Date
    • Thread