Re: Arrange points so polygon is not self intersecting
- From: jaapsch <jaapsch@xxxxxxxxxxx>
- Date: Tue, 10 Jul 2007 06:48:29 -0700
mek...@xxxxxxxxx wrote:
I was wondering if someone knows some sort of algorithm to find an
order for a set of points so that the polygon of those points is not
self-intersecting. Assume this is a 2-D plane with Euclidean geometry.
Michael Press wrote:
Find the convex hull of the points and draw a convex polygon.[snip remainder]
I think that is far too complicated. A much simpler algorithm is this:
1. Connect all the points in some order to get a polygon, probably
self-intersecting.
2. Find a pair of edges AB and CD that intersect.
3. Replace those edges either by AC and BD, or by AD and BC. One of
these choices makes two loops, the other keeps it as one loop. Always
choose the single loop option.
4. repeat 2-3 until there are no intersecting edges.
This algorithm will terminate because the total edge length decreases
at each step and there are only finitely many possible values this
total length can have for any given set of points.
.
- Follow-Ups:
- References:
- Arrange points so polygon is not self intersecting
- From: mekmon
- Re: Arrange points so polygon is not self intersecting
- From: Michael Press
- Arrange points so polygon is not self intersecting
- Prev by Date: Re: New algorithm for the isomorphism of graphs
- Next by Date: Re: lorentz assumes every speed is c
- Previous by thread: Re: Arrange points so polygon is not self intersecting
- Next by thread: Re: Arrange points so polygon is not self intersecting
- Index(es):
Relevant Pages
|