23 Jul 11:27
Re: show mesh in mayavi2, segfault
From: Ondrej Certik <ondrej@...>
Subject: Re: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-23 09:27:48 GMT
Subject: Re: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-23 09:27:48 GMT
On Wed, Jul 23, 2008 at 9:45 AM, Gael Varoquaux <gael.varoquaux <at> normalesup.org> wrote: > On Mon, Jul 21, 2008 at 01:49:56PM +0200, Ondrej Certik wrote: >> On Mon, Jul 21, 2008 at 11:33 AM, fred <fredmfp <at> gmail.com> wrote: >> > Ondrej Certik a écrit : > >> >> It only shows a white rectangle, for me. I would like to see the >> >> actual mesh. If you do "paraview --data=mesh.vtk", click apply and >> >> then set Display->Style->Representation-> Surface With Edges (it >> >> is a popup on the toolbar), it shows the mesh. 10x10 in this case. > >> > Ondrej, > >> > Double-click on Surface module in the tree, then in Property, >> > select Representation: wireframe. > >> > It does what you want. > >> Yes! Thanks a lot, that's exactly what I wanted. Is there a way to see >> the Representation popup in the mayavi2 window directly, without >> having to call double click on the Surface module? > > Actually, when I want to display cool meshes, I use something like > > In [1]: from enthought.mayavi import mlab > > # Somecode to create a mesh, it could really be anything. > In [2]: from numpy import mgrid, random > > In [3]: x, y = mgrid[0:5, 0:5] > > In [4]: z = random.random(x.shape) > > In [5]: m = mlab.mesh(x, y, z, opacity=0.4) > > In [6]: e = mlab.pipeline.extract_edges(m) > > In [7]: t = mlab.pipeline.tube(e, tube_radius=0.1) > > In [8]: s = mlab.pipeline.surface(t, color=(0, 0, 0)) > > Enjoy :). VTK is really cool, and I am starting to think that we are > getting a nice API over it that allows to do very powerfull things in an > easy way. > > In older versions of mayavi, extract_edges might be called extraedges, > but this was in violation of the ETS coding standards, and was harder to > read. We fixed that in Mayavi 3.0a. Thanks, this looks very nice. What are the ETS coding standards? Just Python Coding Style Guidelines? Ondrej _______________________________________________ Enthought-dev mailing list Enthought-dev <at> mail.enthought.com https://mail.enthought.com/mailman/listinfo/enthought-dev
RSS Feed