[vtkusers] A question about vtkTriangleFilter.

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Jan 24 12:51:12 EST 2005


Michele,

	Could you use a vtkCleanPolyData to merge back the duplicate points and 
compare again the number of points. STL is duplicating the point in 
order to save the file.

Thanks
Mathieu

alletto at dei.unipd.it wrote:
> Hi all vtkusers,
> 
> I have tried to convert a binary vtkfile into a Stl ASCII. Convertion seems 
> to be right, but when I open these files with ParaView
> 
> ex.vtk Number of cells 2713
> ex.stl Number of cells 10048 OK but
> 
> ex.vtk Number of Points 6529
> ex.stl Number of Points 5032 ???
> 
> What's wrong? Have I lost information?
> 
> Instead if I use  "filter" -> "TRIANGULATE" with Paraview I get the right 
> number of points.
> 
> This is my code:
> 
> 
>  vtkPolyDataReader *reader = vtkPolyDataReader::New();
>  reader->SetFileName("ex.vtk");
> 
>  vtkTriangleFilter *filter = vtkTriangleFilter::New();
>  //filter->PassVertsOn();
>  //filter->PassLinesOff();
>  filter->SetInput( reader->GetOutput() );
> 
> 
>  vtkSTLWriter *writer = vtkSTLWriter::New();
>  writer->SetInput( filter->GetOutput() );
>  writer->SetFileName("ex.stl");
>  writer->SetFileTypeToASCII();
>  writer->Update();
> 
> Please help me.
> 
> Thank you in advance.
> 
>                                                 Michele Alletto.
> 
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> _______________________________________________
> 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