Answer the question
In order to leave comments, you need to log in
How to generate a random polygon without mutual intersections?
In the WxH field, I want to create an N-gon of a random shape. Without "holes", without "islands", without mutual intersections of faces.
Answer the question
In order to leave comments, you need to log in
My first thought was this:
1. Create a triangle. Add all its edges to the list.
2. Take a random edge from the list, it will be the base of the new triangle.
3. Generate a point so that a new triangle is obtained, none of whose edges intersects the edges from the list. Add two new edges to the list, remove the base.
4. Repeat from step 2 until the desired area of the polygon is reached.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question