[vtkusers] Read .vtk file and save as binary STL file

kenichiro yoshimi rccm.kyoshimi at gmail.com
Sat Jul 29 02:03:39 EDT 2017


Hi Swetha,

Assuming that your data is a triangle polydata set, all vtkSTLWriter
have to do is set the file type to binary, so as to output as binary
STL file. You don't need to call WriteBinarySTL(). Ex:

vtkSmartPointer<vtkSTLWriter> stlWriter =
  vtkSmartPointer<vtkSTLWriter>::New();
stlWriter->SetFileName(filename.c_str());
stlWriter->SetInputData(polyData);
stlWriter->SetFileTypeToBinary();
stlWriter->Write();

Thanks

2017-07-27 23:40 GMT+09:00 Swetha Sharma <swetha.bsharma at gmail.com>:
> Hi,
>
> I have .vtk file which i want to read and convert to binary stl file. The
> documentation has a function
> WriteBinarySTL (vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips) .
> How do I get the information about the vtkpoints and the cellarray?
>
>
>
> -swetha
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list