Re: Getting started with pyvtk

Discussion in 'Python' started by Robert Kern, May 1, 2008.

  1. Robert Kern

    Robert Kern Guest

    Peter Pearson wrote:
    > I'm trying to get started with pyvtk, the Python interface
    > to the Visualization Toolkit, but there's obviously
    > something important that I haven't figured out after an
    > embarrassingly long morning of googling around. When I run
    > sample pyvtk code (example1.py, from
    > http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/pyvtk/examples/example1.py),
    > nothing graphical happens, but some text files appear named
    > example1.vtk and example1b.vtk. Guessing that I need to
    > feed one of these to vtk, I tried "vtk <example1.vtk" and
    > "vtk example1.vtk", but those result in (different) error
    > messages that I think mean example1.vtk is not the language
    > that vtk expects. Simply running "vtk" (apparently 4.0)
    > gets a prompt that has no help command, and "man vtk" just
    > tells me it's like "wish", and "man wish" doesn't address
    > what to do with a vtk file.
    >
    > What key piece am I missing?


    pyvtk is not the Python interface to VTK. It is for the creation of VTK files.
    The vtk(1) command is a Tcl shell with the VTK libraries loaded (I believe).
    Read the VTK documentation for information on the Tcl interface if you really
    want to use it. The Python interface is also included in the VTK sources,
    although it might not have been built on your machine. You have to enable it
    when you build VTK itself. The Python interface is essentially the same as the
    C++ interface. There are Python examples in the VTK source tree.

    --
    Robert Kern

    "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
    Robert Kern, May 1, 2008
    #1
    1. Advertising

  2. Robert Kern

    Paul Melis Guest

    Peter Pearson wrote:
    > On Thu, 01 May 2008 16:45:51 -0500, Robert Kern <> wrote:
    >> pyvtk is not the Python interface to VTK. It is for the
    >> creation of VTK files. The vtk(1) command is a Tcl shell
    >> with the VTK libraries loaded (I believe). Read the VTK
    >> documentation for information on the Tcl interface if you
    >> really want to use it.

    >
    > You're right: I don't really want to use it.
    >
    >> The Python interface is also included in the VTK sources,
    >> although it might not have been built on your machine. You
    >> have to enable it when you build VTK itself. The Python
    >> interface is essentially the same as the C++
    >> interface. There are Python examples in the VTK source
    >> tree.

    >
    > That's the ticket: I don't want to "import pyvtk", I
    > want to "import vtk" and ape /usr/share/vtk/.../*.py.
    >
    > Thanks.


    I'm not sure you've been helped so far as you seem to already understand
    about pyvtk not being the official VTK bindings :)

    So, what would you like to know?

    Paul
    Paul Melis, May 2, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ALuPin
    Replies:
    0
    Views:
    769
    ALuPin
    Sep 21, 2004
  2. Ted R
    Replies:
    3
    Views:
    821
    Rob Young
    Oct 23, 2004
  3. Steve C. Orr, MCSD

    Re: Getting started with Sessions?

    Steve C. Orr, MCSD, Aug 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    319
    Michelle A.
    Aug 21, 2003
  4. LokiDawg

    trouble with pyvtk

    LokiDawg, May 18, 2007, in forum: Python
    Replies:
    3
    Views:
    300
    Gabriel Genellina
    May 21, 2007
  5. Jake Barnes
    Replies:
    2
    Views:
    295
Loading...

Share This Page