Makie: Triangle face colour, mesh


I have a question about Makie, when plotting triangulated mesh surfaces is it possible to colour with flat coloured patches?
Compared to the example in:
I.e. the colour vector defines the colour of each triangles face and not each triangle’s edge points.



You can obtain flat coloured patches by a naive duplication of nodes to ensure that every triangle has different (eventually duplicated) vertices.


Do you have an example?


That seems like a hack. Sounds like something that should be easily implemented (if it isn’t already).


well this “hack” could be turned into a recipe :wink:


Does the problem start because the mesh objects don’t support per-face attributes? I’m not sure if that’s actually the case, but I remember reading this comment:

normals[i*3+1] = NormalType(normal...)
normals[i*3+2] = normals[i*3+1] # hurts, but we need per vertex normals
normals[i*3+3] = normals[i*3+1]