[vtkusers] vtkAppendPolyData woes

Gerard Gorman g.gorman at imperial.ac.uk
Sat Aug 9 07:40:59 EDT 2003


I have been trying to use vtkAppendPolyData (vtk 4.2) in python (2.2) to 
append two polydata sets (they just contain points and pointdata - 
simular data etc). However I'm having zero success. I have appended a 
short piece of code to demonstrate the problem. Any suggestions will be 
greatly appreciated.

Cheers
Gerard.

#!/usr/bin/env python2
import vtk,sys

file0 = sys.argv[1]
file1 = sys.argv[2]

appendF = vtk.vtkAppendPolyData ()

r0 = vtk.vtkXMLPolyDataReader ()
r0.SetFileName (file0)
r0.Update ()
appendF.AddInput (r0.GetOutput ())
# object looks file here
print appendF.GetInput (0)

r1 = vtk.vtkXMLPolyDataReader ()
r1.SetFileName (file1)
r1.Update ()
appendF.AddInput (r1.GetOutput ())
# object looks file here
print appendF.GetInput (1)

# here I get nothing
print appendF.GetOutput ()

#and checking the file I have definatly nothing
w = vtk.vtkXMLPolyDataWriter ()
w.SetInput (appendF.GetOutput ())
w.SetFileName ("appendtest.vtp")
w.Write()





More information about the vtkusers mailing list