Fill area defined by a contour


I’m trying to fill the area of non convex objects. I have the points that define their contours but I don’t know how to fill their area. Currently, I have a mesh collider and a line render. The line renderer is used just to drawn the contour using the points. The mesh uses the same set of points to create a collider contour to detect collisions.
The objects have similar shapes to the examples below:

This is how I’m creating the mesh:

objRenderer.positionCount = conePoints.Length;
objRenderer.BakeMesh(mesh, true);
Vector2[] points = new Vector2[mesh.uv.Length];
for (int i = 0; i < mesh.vertices.Length; i++)
        points <em>= new Vector2(mesh.vertices_.x, mesh.vertices*.z);*_</em>

mesh.uv = points;
objMeshCollider.sharedMesh = mesh;
objMeshCollider.enabled = true;
objMeshFilter.mesh = mesh;
I’ve tried using MeshRenderer but it does not fill the area of the object. It fills the area of the Mesh which is the contour.
Any help would be much appreciated :slight_smile:

For those interested in the solution. Thanks to @Kurt-Dekker , I’ve found it.

You can use this code: Triangulator

For more information about our discussion, see post.