[vtkusers] saving unstructured points

Matt and Elizabeth Kay mandekay at yahoo.com
Thu Feb 28 18:42:06 EST 2002


Hi all-

I'd like to simply write out the points (x,y,z) of my
isosurface (iso structure below) to an ascii file. It
would be nice if the resulting file did not have a
header and only 3 columns corresponding to x,y,z. A
vtkParticleWriter would be nice. Attached below is my
code. Any suggestions would be greatly appreciated!
Can this be done quickly with tcl code? I haven't
tried yet b/c I'm not familiar with tcl file I/O
commands. 

Thanks,
Matt

----------------------------------
package require vtk
package require vtkinteraction

vtkParticleReader xyzv
    xyzv SetSwapBytes 0
    xyzv SetFileName "xyzv.dat"

vtkDelaunay3D del
    del SetInput [xyzv GetOutput]
    del SetTolerance 1.001
    del BoundingTriangulationOff

vtkContourGrid iso
    iso SetInput [del GetOutput]
    iso SetValue 0 0.99
    iso ComputeNormalsOn     

vtkDataSetMapper map_iso
    map_iso SetInput [iso GetOutput]
    map_iso ScalarVisibilityOff
    
vtkActor iso_actor
    iso_actor SetMapper map_iso
    [iso_actor GetProperty] SetColor 0.5 0.8 0.1
    [iso_actor GetProperty] SetDiffuseColor 0.5 0.8
0.1
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
    renWin SetSize 500 500
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

ren1 AddActor iso_actor
ren1 SetBackground 0.9 0.9 0.8

iren AddObserver UserEvent {wm deiconify .vtkInteract}
[ren1 GetActiveCamera] Zoom 1.0
iren Initialize

wm withdraw .

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com



More information about the vtkusers mailing list