Subject: [vtkusers] Getting the number of polygons
Khaled MAMMOU
Khaled.Mamou at ept.rnu.tn
Tue Jan 6 20:05:16 EST 2004
I think you'v got to update the filters you are using.
I'm using a C++ version of vtk but i think the code in Tcl you had to
introduce looks like this :
(I hope that helps)
---------------------------------------------------------------
vtkPolyDataReader $pdreader
$pdreader SetFileName $fileName
vtkDecimatePro $deci
$deci SetInput [$pdreader GetOutput]
$deci SetTargetReduction 0.9
$deci PreserveTopologyOn
vtkPolyDataNormals $pdnormals
$pdnormals SetInput [$pdreader GetOutput]
$pdnormals FlipNormalsOn
# Here is the code added
$pdnormals Update
# Print the number of polygons
set numPolygons [ [$pdreader GetOutput] GetNumberOfPolys ]
puts "(makeSurfaceViewer) number of polygons = $numPolygons"
------------------------------------------------------------------
---------------------------------------------------------------
Subject: [vtkusers] Getting the number of polygons
I want to find the number of polygons in dataset I'm rendering in Vtk.
I'm using the Tcl version of the vtkPolyData GetNumberOfPolys function to
try to get the number of polygons, but I always get a count of zero, so
I must be doing something wrong. I also get a count of zero for
all the other GetNumberOf* functions. Any ideas?
Here's the code I'm using:
---------------------------------------------------------------
vtkPolyDataReader $pdreader
$pdreader SetFileName $fileName
vtkDecimatePro $deci
$deci SetInput [$pdreader GetOutput]
$deci SetTargetReduction 0.9
$deci PreserveTopologyOn
vtkPolyDataNormals $pdnormals
$pdnormals SetInput [$pdreader GetOutput]
$pdnormals FlipNormalsOn
# Print the number of polygons
set numPolygons [ [$pdreader GetOutput] GetNumberOfPolys ]
puts "(makeSurfaceViewer) number of polygons = $numPolygons"
------------------------------------------------------------------
Thanks,
Jenny Simpson
Scientific Computing and Imaging Institute
University of Utah
More information about the vtkusers
mailing list