Painting regions of a mesh segmentation in editor

Hi,

I’m building a mesh segmentation tool (C#) in Unity editor.

I managed to do properly the segmentation but now I have to visualize the segmentation regions in the editor.

Now I’m using Handles to painting triangles of the regions :

But it isn’t fast enough and it paints too the rear portion of the object, relative to the user view, and I don’t want this, it doesn’t do a proper visualization.

How can I fix these problems ? What can I use to visualize properly the regions ? Handles ? Textures ? …

Thanks for your answers !

vertex colors, which is part of Mesh, which is part of the Meshfilter component of the gameobject. There are many ways to do this, you can use the highlighter class to see if the rect and vertices (transform the verts to screen space using scene view camera and loop through the verts). Another more tedious way is to use gizmos and set them at each vert and set colors to the gizmos which set them to the corresponding vert.