20 Jul 03:16
show mesh in mayavi2, segfault
From: Ondrej Certik <ondrej@...>
Subject: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-20 01:19:59 GMT
Subject: show mesh in mayavi2, segfault
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-07-20 01:19:59 GMT
Hi, I'd like to visualize a finite element mesh in mayavi2. I have it in .vtk file. Is there a way to tell mayavi2 to show it? I didn't figure it out. So I adapted this script: http://paste.debian.net/11654/ and it works fine, it shows 4 triangles. Now I'd like to import our FEM package that can read the .vtk file and get the mesh data, but mayavi2 segfaults, if I uncomment the line 15 in the above script... How is that possible? Here is the gdb trace: $ gdb python GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... (gdb) run show_grid.py Starting program: /usr/bin/python show_grid.py [Thread debugging using libthread_db enabled] [New Thread 0xb7d768c0 (LWP 30519)](Continue reading)
Please see the attached file.
Cheers,
> 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
RSS Feed