[vtkusers] Re: problem viewing merged PolyData sets using AppendPolyData

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Feb 3 11:47:13 EST 2005


Hi Denis,

At a guess, I would say your vtkPolyData's have points (geometry) but no
vertices (topology). vtkGlyph3D needs both to work, although in theory it
should only need the points.

Here's a trick to get it to work:

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

verts = vtk.vtkMaskPoints()
verts.SetInput(apd.GetOutput())
verts.GenerateVerticesOn()
verts.SetOnRatio(1)

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

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

...
...


hth

Goodwin
"Denis Saussus" <dsaussus at fugro-jason.com> wrote in message
news:F42290EAAE100A4A99A3A9BE2059504FBDB11C at MAIL.fugro-jason.local...
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.
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list