how to store vtkPolyData using vtkSTLWriter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to store vtkPolyData using vtkSTLWriter

Kailu Shan
hi,

Usually I use vtkPolyDataWriter to store my vtkPolyData, but now failed by trying vtkSTLWriter. Below is my code:

vtkPolyData   *pvtkData= = vtkPolyData::New();
...
vtkSTLWriter *pstlWriter =vtkSTLWriter::New();
pstlWriter->SetInput(pvtkData);
pstlWriter->SetFileName("out.stl"); 
pstlWriter->Write();

How to make it work?

Best Regards,
Kailu



 


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: how to store vtkPolyData using vtkSTLWriter

Sebastien Jourdain-2
Try SetInputData instead of SetInput

On Wed, May 17, 2017 at 4:38 AM, Kailu Shan <[hidden email]> wrote:
hi,

Usually I use vtkPolyDataWriter to store my vtkPolyData, but now failed by trying vtkSTLWriter. Below is my code:

vtkPolyData   *pvtkData= = vtkPolyData::New();
...
vtkSTLWriter *pstlWriter =vtkSTLWriter::New();
pstlWriter->SetInput(pvtkData);
pstlWriter->SetFileName("out.stl"); 
pstlWriter->Write();

How to make it work?

Best Regards,
Kailu



 


_______________________________________________
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



_______________________________________________
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