21 Jul 14:31
Re: show mesh in mayavi2, segfault
From: fred <fredmfp@...>
Subject: Re: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-21 12:31:52 GMT
Subject: Re: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-21 12:31:52 GMT
Ondrej Certik a écrit : > > 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? Dunno> Yes, it does exactly what I wanted. Thanks again. Is there a way to > script mayavi from ipython? If I do the following, it breaks: > > In [1]: from enthought.mayavi.scripts import mayavi2 > > In [2]: mayavi2.standalone(globals()) Yes, I think this is only meaningful in a script. You can do what you want like this: marsu[pts/3]:~/{6}/> ipython -wthread Python 2.5.2 (r252:60911, Apr 7 2008, 01:11:55) Type "copyright", "credits" or "license" for more information. IPython 0.8.3.svn.r3001 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. marsu:~/{1}/> from enthought.mayavi.app import Mayavi marsu:~/{2}/> from enthought.mayavi.sources.vtk_file_reader import VTKFileReader marsu:~/{3}/> from enthought.mayavi.modules.surface import Surface marsu:~/{4}/> src=VTKFileReader() marsu:~/{5}/> src.initialize('mesh.vtk') marsu:~/{6}/> m=Mayavi() marsu:~/{7}/> m.main() marsu:~/{8}/> m.script.new_scene() marsu[14:28:50]:~/{9}/> m.script.add_source(src) And so on... HTH. Cheers, -- -- Fred
> Yes, it does exactly what I wanted. Thanks again. Is there a way to
> script mayavi from ipython? If I do the following, it breaks:
>
> In [1]: from enthought.mayavi.scripts import mayavi2
>
> In [2]: mayavi2.standalone(globals())
Yes, I think this is only meaningful in a script.
You can do what you want like this:
marsu[pts/3]:~/{6}/> ipython -wthread
Python 2.5.2 (r252:60911, Apr 7 2008, 01:11:55)
Type "copyright", "credits" or "license" for more information.
IPython 0.8.3.svn.r3001 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
marsu:~/{1}/> from enthought.mayavi.app import Mayavi
marsu:~/{2}/> from enthought.mayavi.sources.vtk_file_reader import
VTKFileReader
marsu:~/{3}/> from enthought.mayavi.modules.surface import Surface
marsu:~/{4}/> src=VTKFileReader()
marsu:~/{5}/> src.initialize('mesh.vtk')
marsu:~/{6}/> m=Mayavi()
marsu:~/{7}/> m.main()
marsu:~/{8}/> m.script.new_scene()
marsu[14:28:50]:~/{9}/> m.script.add_source(src)
And so on...
HTH.
Cheers,
RSS Feed