Ondrej Certik | 21 Jul 02:15

Re: show mesh in mayavi2, segfault

On Sun, Jul 20, 2008 at 4:46 AM, Prabhu Ramachandran
<prabhu@...> wrote:
> Ondrej Certik wrote:
>> 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.
>
> This should work:
>
> $ mayavi2 -d foo.vtk -m Outline -m IsoSurface

It says:

ERROR|2008-07-21 02:04:30,892|Cannot contour: No scalars in input data!

paraview shows the mesh just fine. The mesh file is attached.

>
> BTW, which version of mayavi2 are you talking about?
>
> $ mayavi2 -V
>
> should help.

$ mayavi2 -V
MayaVi 2.2.0

>
>> 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?
>
> Good question.  Can you run the script like so:
>
> $ mayavi2 -x show_grid.py
>
> Could you check if that works for now and we can move from there.

This is what happens:

$ mayavi2 -x show_grid.py
bug-buddy: symbol lookup error: /usr/lib/libxml2.so.2: undefined
symbol: gzopen64

The same as before:

$ python show_grid.py
bug-buddy: symbol lookup error: /usr/lib/libxml2.so.2: undefined
symbol: gzopen64

>
> [...]
>
>> The sfepy package can be found at: http://code.google.com/p/sfepy/
>>
>> Do you have any pointers? If it segfaults, its not very usable, so I'd
>> like to fix it. Looking at Objects/frameobject.c:559 it contains:
>
> I suspect it has something to do with the hack we use to allow a user to
> run our standard examples as python example.py *and* mayavi2 example.py.
>  In order to be able to run it as python example.py we need to start up
> mayavi and re-execute the code to run.  It is a hack but we really
> wanted users to be able to run the script as python example.py.

No problem. I just want to see the mesh in mayavi. Either way.
Otherwise I'll have to continue using paraview, but mayavi2 seems to
be more pythonic and easier to script, if it doesn't segfault. :)

There is clearly a bug somewhere, but it may be difficult to trace it.
But maybe it's easy for you to get mayavi2 show the mesh from the
attached vtk file and that's what I am interested in.

Thanks a lot,
Ondrej
Attachment (mesh.vtk): application/octet-stream, 6700 bytes
_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane