[vtkusers] reading triangles data

Patrick Schuska schuska at dbi.udel.edu
Tue Oct 21 11:22:31 EDT 2003


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 .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20031021/2b5c8550/attachment.htm>


More information about the vtkusers mailing list