I need an algorithm to generate a closed simple (no self-intersections) polygonal curve. It would make a perfect labyrinth for my game.
Can you please point me to the correct keywords?
One idea: generate a bunch of random points, then enclose them using alpha shapes.
There's a parameter you can tune to decide how "tight" the resulting polygon is.
Another idea: generate a bunch of random shapes (eg. generate random simpler polygons, or use metaballs), then compute their union.
You may need to resort to some tricks to make sure the union is only a single shape, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With