r/gamedev • u/simswerdev • Jun 25 '14
Question about 2D polygon angle simplification
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 (a polygon simplification 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!
View all comments
Show parent comment
2
u/RandyGaul @randypgaul Jun 26 '14
You can definitely just snap the vertex to a 15 degree boundary by moving it. I don't think any forces, jacobians or lagrangians are necessary here. Looks like you got a very nice answer on the mathexchange!