[Numpy-discussion] constant shaded triangle mesh in mayavi2
Fri Oct 1 09:44:01 CDT 2010
On Thu, Sep 30, 2010 at 23:04, Geoffrey Irving <firstname.lastname@example.org> wrote:
> On Fri, Oct 1, 2010 at 11:39 AM, Robert Kern <email@example.com> wrote:
>> 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
> Cool, that seems to work for static plots (with "contours" replaced
> with "contour"). However, it breaks dynamic updates if I change data
> interactively on trait changes. For vertex data, I'm using the
> following code for interactive updates:
> def update_plot(self):
> borrowed from
> where plot is generated with triangular_mesh(). How do I force an
> update of the surface if I generate it myself and use cell data?
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion