[Numpy-discussion] constant shaded triangle mesh in mayavi2
Thu Sep 30 16:00:32 CDT 2010
On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern <email@example.com> wrote:
> On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving <firstname.lastname@example.org> wrote:
>> I'm not sure where the correct place to ask questions about Mayavi, so
>> feel free to redirect me elsewhere.
>> I have a triangle mesh with a bunch of data on each face. The only
>> color-relevant argument to triangular_mesh I know about is scalars,
>> which is one value per vertex. Is there a way to set color per
>> triangle, ideally with control over rgb separately so I can visualize
>> three different fields at once?
> Pretty difficult, unfortunately. The only way I have found is to
> assign UV texture coordinates to the vertices and slap on a texture.
> Assigning the UV coordinates is usually not easy.
Is this a limitation in VTK, TVTK, or the Mayavi python code? The VTK
documentation seems to imply it supports cell data on polygon meshes
(though I don't know how one would set them):
"Point and cell attribute values (e.g., scalars, vectors, etc.)
also are represented"
I'm happy to hack TVTK or Mayavi (in order of happiness) to support
cell data if VTK supports it.
More information about the NumPy-Discussion