[Numpy-discussion] constant shaded triangle mesh in mayavi2

Geoffrey Irving irving at naml.us
Thu Sep 30 17:00:32 EDT 2010


On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern <robert.kern at gmail.com> wrote:
> On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving <irving at naml.us> wrote:
>> Hello,
>>
>> I'm not sure where the correct place to ask questions about Mayavi, so
>> feel free to redirect me elsewhere.
>
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>> 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):

    http://www.vtk.org/doc/release/5.6/html/a01445.html
    "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.

Geoffrey



More information about the NumPy-Discussion mailing list