[vtkusers] reading triangles data

Berk Geveci berklist at nycap.rr.com
Tue Oct 21 12:06:50 EDT 2003


Hi.
Look at the online document describing the VTK file formats
http://www.vtk.org/pdf/file-formats.pdf

Did Amira export this file?

-Berk

On Tue, 2003-10-21 at 11:22, Patrick Schuska wrote:
> Hi.
> 
> I am trying to read triangles data (I took the file from amira) with
> vtk. But it doesn`t work. There comes allways the same error message.
> 
> I think I did something with the header wrong.
> 
> It looks like this..
> 
>  
> 
>  
> 
> # vtk DataFile Version 3.0
> 
> Triangle Data
> 
>  
> 
> BINARY
> 
>  
> 
> DATASET POLYDATA
> 
>   
> 
> TRIANGLES 3790
> 
>  
> 
> …data…
> 
>  
> 
> can anybody help me??
> 
> Thanks, Patrick.
> 
>  
> 
>  
> 
> error message:
> 
>  
> 
> ERROR: In C:\martink\vtk42\VTK\IO\vtkPolyDataReader.cxx, line 305
> 
> vtkPolyDataReader (0x064B5200): Unrecognized keyword: triangles
> 
>  
> 
> my vtk file.
> 
>  
> 
>  
> 
> package require vtk
> 
> package require vtkinteraction
> 
>  
> 
> # Create the standard renderer, render window
> 
> # and interactor
> 
> vtkRenderer ren1
> 
> vtkRenderWindow renWin
> 
>     renWin AddRenderer ren1
> 
> vtkRenderWindowInteractor iren
> 
>     iren SetRenderWindow renWin
> 
>  
> 
> # Create the reader for the data
> 
> vtkPolyDataReader reader
> 
> #vtkDataReader reader
> 
>  reader SetFileName "D:/amira/ear2bsurf.vtk"
> 
>  
> 
>  
> 
> vtkOutlineFilter outlineData
> 
>   outlineData SetInput  [reader GetOutput]
> 
> vtkPolyDataMapper mapOutline
> 
>   mapOutline SetInput [outlineData GetOutput]
> 
> vtkActor outline 
> 
>   outline SetMapper mapOutline
> 
>   [outline GetProperty] SetColor 0 0 0
> 
>  
> 
>  ren1 AddActor outline 
> 
>  
> 
> ren1 SetBackground 1 1 1
> 
> renWin SetSize 600 600
> 
> renWin Render
> 
>  
> 
> proc TkCheckAbort {} {
> 
>   set foo [renWin GetEventPending]
> 
>   if {$foo != 0} {renWin SetAbortRender 1}
> 
> }
> 
> renWin AddObserver AbortCheckEvent {TkCheckAbort}
> 
>  
> 
> iren AddObserver UserEvent {wm deiconify .vtkInteract}
> 
> iren Initialize
> 
>  
> 
> wm withdraw .
> 
-- 
Berk Geveci <berklist at nycap.rr.com>




More information about the vtkusers mailing list