Polygonization of Implicit 2D Function

I am currently searching for a fast library which does 2D polygonization of a SDF or implicit function.

mmg seems to do what I want, however, I don’t need an actual triangulated mesh. I just need the polygon (with holes). I couldn’t find much about this in the tutorials or examples.

Is this possible with mmg?

Hi Aurel,

Mmg needs a triangulation to work but if you are interested only at recovering the polygon at the end of the process, you can get only the output edges and ignore the triangles.

I hope that it will help you,
Best Regards,

Algiane

Then I may have to give this a try and see if it is efficient enough this way. Or if there is too much overhead.

So I get some sort oft mesh representation as an output, which is iterable, and I would have to extract the outer and inner polygons myself? Or, is there some functionality or meta data for the mesh to get me started here?

Hi,

I am not sure of what you mean by “polygon”: if you want to recover the boundaries of the mesh, it is return by Mmg (as a list of edges in 2D and a list of triangles and edges in 3D) so you just have to get it. By doing this, the only issue is that the list of mesh nodes contains the vertices of the entire mesh (not only the vertices of the boundaries). You can keep it or you can write a small program to clean unused points.

Regards,
Algiane