Finding the concave hull of a set of points such that every point is in the boundary

936 Views Asked by At

So I am attempting to make complex polygons from a set of randomly generated vertices in 2D. I would like to allow concave polygons to exist, as well as to assure that every vertex in the set is included in the boundary (so the algorithm must be able to handle convex AND concave hulls), and also assure that the lines created by the boundary never intersect. Every version of a concave hull generating algorithm has assumed that it is acceptable to have varying levels of concavity, and that some points may not be a part of the boundary.

I feel like this may be a much simpler problem than it seems to me, but I cant figure out how to make sure I can order the vertices in such a way that drawing a line between vertices having adjacent indices in the list makes a polygon conforming to those standards. For a convex hull it is easy to just find the centroid of the polygon and sort the vertices by their polar angle respective to it, but I am currently unaware of an equivalent idea for concave.

1

There are 1 best solutions below

1
TreeTraversalThomas On

i had to come up with a solution to this problem with a twist. I had to render a set of randomized points basically to a concave hull. I used the marching cubes algorithm generating A concave hull! Basically i just counted and weighed each point reveived, and computed edgeindeces for rendering them depending on my value grid. https://stemkoski.github.io/Three.js/Marching-Cubes.html i oriented my self on this implementation.... have fun :)