Smoothed Contour Mesh from Grid Analyzed Mesh

There some problems to expose before passing to the solution:

  • “mesh” and “smooth” don’t really go along very well;
  • your mesh is colored like a picture, each square face have its color (and is not welded to neighbors), while usually mesh are colored per-vertex.
    Here you could convert each pixel-square in a vertex, resulting in a new mesh which is 1 face shorter in width and height. Or you could calculate the vertex color/value from the neighbor faces, as i did.
  • you didn’t deliver a gradient to “translate” from color to numbers and vice-versa, so i just ignored the colors and worked with the numbers.

Now, the idea would be to move the mesh vertexes on Z by their values, and then slice the mesh into regions. But that’s old story and slow.
Instead, luckily for us @laurent_delrieu exist!
I’m using Laurent’s c# code from Divide mesh along contour line


Mesh_split.gh (72.9 KB)

3 Likes