[vtkusers] vtkSTLWriter after vtkQuadricDecimation

Mike Jackson imikejackson at gmail.com
Wed Sep 5 15:14:48 EDT 2007


STLWriter only works on Triangles. You are most likely producing  
QUADS. You need to triangulate the quads (vtkTriangleFilter) first,  
then pass the triangulated output to the STL writer..

Try that and see what happens.

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Sep 5, 2007, at 1:50 PM, <vmh104-vtk at yahoo.com> wrote:

> 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
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list