The code is not complicated but I agree with @dpsanders, this should be a convenience method from the package
function _explode_vertices(vertices, faces)
new_vertices = similar(vertices, 0)
new_faces = similar(faces, 0)
for (i, face) in enumerate(faces)
for vertex in vertices[face]
push!(new_vertices, vertex)
end
push!(new_faces, Triangle(3i - 2:3i...))
end
return new_vertices, new_faces
end
newmesh = GLNormalMesh(_explode_vertices(oldmesh.vertices, oldmesh.faces)...)
feel free to upstream this code under current Meshing.jl license.
Thanks @juliohm, I knew that Meshes could do it, but I wonder if @sdanisch or another Makie developper can explain if this is a GLMakie (or OpenGL even) limitation that forbids having this built-in, or something else.