[vtkusers] problem viewing merged PolyData sets using AppendPolyData

Denis Saussus dsaussus at fugro-jason.com
Thu Feb 3 06:05:08 EST 2005


I am plotting a vtkPolyData set containing 3d points so that
they display as spheres.  I can get this to work very easily.

Now I have two vtkPolyData sets, each containing 3d points.
I want to plot them using a single mapper/actor.  I am doing this
simply by using vtkAppendPolyData to merge the two sets into
one.  My problem is that now nothing shows up.  

Below is the script I am using.  Help greatly aprpeciated...

##########################
# Why does this not work?
##########################

somePolyData = vtk.vtkPolyData()
# assume this contains some valid 3d points

apd = vtk.vtkAppendPolyData()
apd.AddInput(somePolyData)
apd.AddInput(someMorePolyData)

aSphere = vtk.vtkSphereSource()
aSphere.SetRadius(1.0)

spheres = vtk.vtkGlyph3D()
spheres.SetInput(apd.GetOutput())
spheres.SetSource(aSphere.GetOutput())

mapSpheres = vtk.vtkPolyDataMapper()
mapSpheres.SetInput(spheres.GetOutput())

spheresActor = vtk.vtkActor()
spheresActor.SetMapper(mapSpheres)

ren = vtk.vtkRenderer()
ren.AddActor(spheresActor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
renWin.Render()
iren.Start()

Denis Saussus

Fugro-Jason 
Plaza Building, Weena 598 
PO Box 1573 
3000 BN  ROTTERDAM 
The Netherlands 

+31 (0)10 2801544 - direct 
+31 (0)10 2801511 - fax 

Visit us at : www.fugro-jason.com 

FUGRO-JASON ..... #1 in reservoir characterization

This e-mail and any files transmitted with it are confidential and
intended solely for the use of the addressee. This e-mail shall not be
deemed binding unless confirmed in writing.  If you have received it
by mistake, please let us know by e-mail reply and delete it from your
system; you may not copy this message or disclose its contents to
anyone. Please note that any views or opinions presented in this
e-mail are solely those of the author and do not necessarily represent
those of the company. E-mail transmission cannot be guaranteed to be
secure or error-free. The sender therefore does not accept liability
for any errors or omissions in the contents of this message, which
arise as a result of e-mail transmission.  transmission.



More information about the vtkusers mailing list