[vtkusers] vtkDecimatePro question
Brian Webb
webbb at desertscenes.net
Tue Mar 19 13:10:34 EST 2002
I'm trying to use vtkDecimatePro to decimate a model, and it appears to be
just removing facets and leaving holes in the model. According to the
documentation it appears that calling PreserveTopologyOn should prevent this
from happening. This works with a standard (fran) model, but it doesn't on
my models.
I'm thinking that there's something inconsistent in my models (the normals
are inconsistent, or the polygons are not ordered correctly), but I can't
figure out a way to correct it. I tried vtkPolyDataNormals, but that didn't
work.
Any ideas on what else I could try would be appreciated. I've included the
relevant parts of my script at the end of this email.
Thanks,
Brian Webb
#
# Read the model.
#
vtkOBJReader importer
importer SetFileName mig27.obj
#vtkPolyDataReader importer
# importer SetFileName "$VTK_DATA_ROOT/Data/fran_cut.vtk"
vtkTriangleFilter triangs
triangs SetInput [importer GetOutput]
vtkPolyDataNormals normals
normals SetInput [triangs GetOutput]
normals FlipNormalsOn
normals SplittingOff
normals ConsistencyOn
normals ComputePointNormalsOn
normals ComputeCellNormalsOn
vtkDecimatePro mesh
mesh SetInput [triangs GetOutput]
mesh SetTargetReduction 0.7
mesh PreserveTopologyOn
mesh AccumulateErrorOn
mesh SplittingOff
mesh DebugOn
#
# Create the mapper.
#
vtkPolyDataMapper mapper
mapper SetInput [mesh GetOutput]
More information about the vtkusers
mailing list