Mayavi/mlab: Plot Triangles With Colour Data Per Triangle, Not Per Vertex
If one uses the function triangular_mesh one can pass a set of triangles, given as lists of indices, the vertex positions and a set of data to to assign colours to the vertices. T
Solution 1:
This was asked on the scipy mailing list too.
You can't do it with triangular_mesh, but you can if you make a generic surface using a triangular mesh as a source.
s = mlab.pipeline.triangular_mesh_source(x,y,z,triangles)
s.data.cell_data.scalars = .... # Your data here.surf = mlab.pipeline.surface(s)
surf.contours.filled_contours = True
http://mail.scipy.org/pipermail/numpy-discussion/2010-September/053040.html
Post a Comment for "Mayavi/mlab: Plot Triangles With Colour Data Per Triangle, Not Per Vertex"