r/truegamedev • • Jun 25 '14

Angular simplification of polygons question

I've been looking up some ways to change the red polygon into the blue polygon in this diagram. You'll notice that the new blues angles are all multiples of 15°. I don't mind degeneration of the original polygon and the "corrections" can be iterative or simultaneous. I need it for level generation if that helps. The final polygon can be concave or convex, no problems. I think the Ramer-Douglas-Peucker algorithm could be useful somehow, but maybe there's something else I don't know about. Can anyone push me in the right direction? What do we call this problem? Thanks a lot!

3 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/simswerdev Jun 25 '14

Brilliant, thank you! No need for the PBD though, because this is a lo-fi, once-off iteration during map generation. I'll strong-hand any creases until it fits. The wobble-until-snapping suggestion in your last paragraph is perfect. I'll post what I end up with. Thanks again!