I’m revisiting some old code for coloring mesh faces (without them bleeding into each other!), and feel like I might be missing something here. The basic approach I’ve been using is to:
- Unweld the mesh, or, make a new mesh and append the faces onto this.
- Color the face corners of this now unwelded mesh.
Now this approach works just fine.
But both unwelding and setting the colors are pretty heavy processes (at about 280 and 140 ms respetivley in this case). So I am looking to speed this up a bit, and wondering if there might be better/faster overall approaches that I am missing?
Leading me to: At least sitting setting the colors can be sped up by calling
MeshVertexColorList.SetColor, however this only appears to set one corner on fully unwelded meshes (but is substantially faster than setting each corner individually):
While it works as expected on a welded mesh (but of course with colors bleeding across faces):
And yes, I do realize that writing a compiled C# component (or, eww, a C++ plugin), or threading etc. can speed things up. But I’m asking what I might be missing in terms of the base logics here, and perhaps, also pointing out a bug (i.e.
MeshVertexColorList.SetColor) and/or features that might be missing in RhinoCommon.