Quickly determining if a closed polyline is clockwise or counter-clockwise
(Apr 9, 2011 01:24 PM)Skorche Wrote: You do need a point inside the polygon to start though. An easy way to handle that would be to pick a segment on the perimeter. Have the point be the midpoint of the segment, and the ray direction be it's negative normal.
How will you know the normal if you don't know the winding order, though? I suppose you could check in both possible normal directions, and determine winding based on which one gets an intersection with another segment.
You say there's no guarantee of convexity/concavity; hopefully there's at least a guarantee that it's not self-intersecting? If not, you're hosed, since it'd have both clockwise and counterclockwise portions in that case.
| Messages In This Thread |
|
Quickly determining if a closed polyline is clockwise or counter-clockwise - TomorrowPlusX - Apr 9, 2011, 11:56 AM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - stevejohnson - Apr 9, 2011, 12:32 PM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - TomorrowPlusX - Apr 9, 2011, 12:44 PM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - Skorche - Apr 9, 2011, 01:24 PM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - ThemsAllTook - Apr 9, 2011 01:40 PM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - TomorrowPlusX - Apr 9, 2011, 01:53 PM
RE: Quickly determining if a closed polyline is clockwise or counter-clockwise - Skorche - Apr 9, 2011, 04:03 PM
|
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| ? Techniques for determining speed / efficiency | Elphaba | 9 | 4,219 |
Jul 19, 2009 03:42 AM Last Post: DoG |
|
| Quickly refreshing NSViews | Steven | 24 | 10,551 |
Nov 13, 2002 07:30 AM Last Post: Steven |
|

