Say I have a square with a lot of points around the edges like so:
.---o---o---.
|...............|
|...............o
o..............|
|...............|
'---o-----o-'
What is the simplest solution to traverse the edge and connect each point with the previous one to create non-overlapping line segments?
The algorhitm should also add the missing corner points so that no slanted 'shortcut' segmens are created in the corners.