473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting started with pyvtk

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.c...s/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?

--
To email me, substitute nowhere->spamcop, invalid->net.
Jun 27 '08 #1
5 7689
On 1 mei, 22:54, Peter Pearson <ppear...@nowhere.invalidwrote:
I'm trying to get started with pyvtk, the Python interface
to the Visualization Toolkit,
It looks like you're using this package:
http://cens.ioc.ee/projects/pyvtk/

These are not the official Python bindings to VTK, but seem to be an
add-on that allow you to manipulate VTK _files_ from Python.

The official bindings are included in the VTK distribution and can be
enabled at build-time (assuming you build VTK yourself).

For a simple example that will open a window and show some 3D object,
see for example the example code the vtkConeSource class:
http://public.kitware.com/cgi-bin/vi...ype=text/plain
Simply running "vtk" (apparently 4.0)
VTK 4.0 is really really old. Consider switching to 5.0 at least or
use the CVS version if you feel adventurous.

Hope this helps,
Paul
Jun 27 '08 #2
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.c...s/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

Jun 27 '08 #3
On Thu, 01 May 2008 16:45:51 -0500, Robert Kern <ro*********@gmail.comwrote:
>
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.

--
To email me, substitute nowhere->spamcop, invalid->net.
Jun 27 '08 #4
Peter Pearson wrote:
On Thu, 01 May 2008 16:45:51 -0500, Robert Kern <ro*********@gmail.comwrote:
>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

Jun 27 '08 #5
On Fri, 02 May 2008 17:40:02 +0200, Paul Melis wrote:
>
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?
Thanks, I think I'm set. For the benefit of the next instance of
me googling around trying to get started driving VTK from Python,
here's what I wanted to find:

- Ignore pyvtk.

- Import vtk.

- To see how to drive VTK from Python, run all the files
of the form /usr/share/vtk/.../*.py and see which ones
do something like what you want to do.

--
To email me, substitute nowhere->spamcop, invalid->net.
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already...
84
by: Bibby | last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: ...
6
by: Jack Duijf | last post by:
Hello, I am looking for a person in The Netherlands that is willing to help me getting started with Vb.net. Please send a message to jack@aicn.nl if you can help me getting started with the...
3
by: LokiDawg | last post by:
Am trying to stumble through the demos for mayavi, after having set up PyVTK-0.4.74 (together with numpy, scipy, vtk, and mayavi. I'm trying to use pyvtk to generate a vtk dataset with the...
1
by: =?Utf-8?B?Q29kZVNsaW5nZXI=?= | last post by:
I plan to build my own 2008 Server/Hyper-V system and will not be using one of the tested Dell or HP systems from the release notes and could use some pointers as to my assumnptions and answers to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.