[vtkusers] A question about vtkTriangleFilter.

alletto at dei.unipd.it alletto at dei.unipd.it
Mon Jan 24 11:34:00 EST 2005


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/



More information about the vtkusers mailing list