[vtkusers] How can I save to STL format?

Bill Lorensen bill.lorensen at gmail.com
Fri Jun 4 16:32:00 EDT 2010


The STLWriter only writes triangles. Actually, it only writes the
first three points of any polygon. vtkStripper makes triangle strips.
Try writing the output of the filter prior to the vtkStripper and I
think you will be pleased,

Bill

2010/6/4 noc <hawkingyy at hotmail.com>:
> Hi all,
>
> Now, I'm doing marching cubes. I wanna save the resault(the 3D image) to STL
> format,
> I tried this:
> --code--
> vtkSTLWriter * writeSTL = vtkSTLWriter ::New();
>   writeSTL->SetFileName("D:/data/feet.stl");
>   writeSTL->SetInput(stripper->GetOutput());   //data from vtkStripper
>   writeSTL->Write();
> --code--
>
> but it didn't work. The feet.stl is only 1KB.
> However, I can see the 3D surface in RenderWindow. I don't konw why.
> Could any one help me, please?
>
> Thanks so much!!!
>
> Regards,
>
> Danile
>
> ________________________________
> 使用新一代 Windows Live Messenger 轻松交流和共享! 立刻下载!
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list