Hi,
My objective is to generate completely random shape and not randomly choose a shape.
[list] - [b]First [/b] I thought of creating a grid divided into [i]x[/i] parts. Then add random points on the grid then fill that polygon. [b]But[/b] the issue with that is that i should get the enclosing polygon, and by that i mean if i add a point that would force the polygon to draw the next line over itself then it shouldn't add this point. [b]And[/b] to fix this issue, i have no idea left.
- [b]Then[/b] I somehow found a topic on geometry suggesting that you could create shapes with [i]Delaunay's triangulation[/i] performed on random points. [i]So now the issue is how to extract a shape out of this ?[/i] Now that i have something like this : https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Delaunay_Triangulation_%28100_Points%29.svg/360px-Delaunay_Triangulation_%28100_Points%29.svg.png
Source: Wikipedia
How do i get the shape ? I mean how do i remove the segments that are inside the edges ?
[EDIT]Solution : [list]
[li]An edge is a line segmnet that is part of only one triangle.
[/li][/list]
- [b]Or[/b] Is there any other way to generate random shapes ?
Thank you for reading.[/list]
)This volume is essentially the normal line of the plane shifted over to the vertices of the edge. In order to test if a point is within the volume, all you need to do is treat the sides of the volume as planes themselves and then use the plane equation to test if it’s within the volume or not. If all the points within the volume are on one side of the edge plane, then the edge is… well, an edge!