[vtkusers] Making the python binding more pythonesque

Arnd Baecker arnd.baecker at web.de
Sat Feb 15 14:54:49 EST 2014


On Sat, 15 Feb 2014, Dov Grobgeld wrote:

> I've been thinking about how to make the vtk python binding more pythonesque? Here are a couple of examples and what I have in mind:

[...]

tvtk (traited vtk, 
see http://docs.enthought.com/mayavi/mayavi/data.html
and links there) provides a more pythonic interface to tvtk
and is the basis for the Mayavi Data Visualizer.

With tvtk you can for example do:

from tvtk.api import tvtk

poly_line = tvtk.PolyLine()
poly_line.points.append([0, 0, 0])
poly_line.points.append([0, 1, 2])

for pt in poly_line.points:
     print pt, type(pt)

Best, Arnd


More information about the vtkusers mailing list