[vtkusers] vtkPolyDataWriter in vtkpython
Olumide
50295 at web.de
Wed May 13 20:08:23 EDT 2009
> Apply a vtkTransform filter.
Thanks. I have (see my attempt below -- the transform has no noticeable
effect). I do not wish to visualize the data. Rather, my intention is to
have the script write a VTK file.
Is there comprehensive vtkpython tutorial available anywhere? The "VTK
User's guide" and "Visualization toolkit" are slanted toward the C++ and
Tcl APIs.
Thanks.
########################################################
#!/usr/bin/env python
import vtk
cone = vtk.vtkConeSource()
cone.SetHeight( 3.0 )
cone.SetRadius( 1.0 )
cone.SetResolution( 10 )
transform = vtk.vtkTransform()
transform.Translate(3.7, 0.0, 28.37)
transform.Scale(5, 5, 5)
transform.RotateY(90)
tpd1 = vtk.vtkTransformPolyDataFilter()
tpd1.SetInputConnection(cone.GetOutputPort())
tpd1.SetTransform(transform)
#Write in file
w = vtk.vtkPolyDataWriter()
w.SetInput(cone.GetOutput())
w.SetFileName("junk.vtk")
w.Write()
More information about the vtkusers
mailing list