[vtkusers] vtkSTLWriter after vtkQuadricDecimation

vmh104-vtk at yahoo.com vmh104-vtk at yahoo.com
Wed Sep 5 13:50:36 EDT 2007


Hi,

Pretty new at this. I'm sure I'm doing something stupid but I can't see
it. Trying to write an STL decimator using tcl vtk, In the example
below decimated GetActualReduction does return a good number and
according to the doc: "Gets the actual reduction. This value is only
valid after the filter has executed". However when I pass this to
vtkSTLWriter the outfile is about as large as the infile. WHat am I
doing wrong?

Thx,

Vincent

vtkSTLReader sr
    sr SetFileName E:/test.stl

vtkTriangleFilter triangles1
   triangles1 SetInputConnection [sr  GetOutputPort]
   triangles1 Update

vtkQuadricDecimation decimated
   decimated SetInputConnection [triangles1 GetOutputPort]  
   decimated SetTargetReduction .01
   decimated AttributeErrorMetricOn
   decimated UpdateWholeExtent

vtkSTLWriter stl
   stl SetInputConnection [decimated GetOutputPort]
   stl SetFileName E:/out.stl
   stl SetFileType 2
   stl Write

 





More information about the vtkusers mailing list