<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thank u so much!<BR>
You're right, The STLWriter only writes triangles. If I use the following code, it works!<BR>
--code--<BR>
vtkSTLWriter * writeSTL = vtkSTLWriter ::New();<BR> writeSTL->SetFileName("D:/data/feet1.STL");<BR> writeSTL->SetInput(marchingcubes->GetOutput()); //data directly from Marching Cubes<BR> writeSTL->Write();<BR>--code--<BR>
<BR>
Thanks again!!!<BR>
<BR>
Daniel<BR> <BR>> Date: Fri, 4 Jun 2010 16:32:00 -0400<BR>> Subject: Re: [vtkusers] How can I save to STL format?<BR>> From: bill.lorensen@gmail.com<BR>> To: hawkingyy@hotmail.com<BR>> CC: vtkusers@vtk.org<BR>> <BR>> The STLWriter only writes triangles. Actually, it only writes the<BR>> first three points of any polygon. vtkStripper makes triangle strips.<BR>> Try writing the output of the filter prior to the vtkStripper and I<BR>> think you will be pleased,<BR>> <BR>> Bill<BR>> <BR>> 2010/6/4 noc <hawkingyy@hotmail.com>:<BR>> > Hi all,<BR>> ><BR>> > Now, I'm doing marching cubes. I wanna save the resault(the 3D image) to STL<BR>> > format,<BR>> > I tried this:<BR>> > --code--<BR>> > vtkSTLWriter * writeSTL = vtkSTLWriter ::New();<BR>> > writeSTL->SetFileName("D:/data/feet.stl");<BR>> > writeSTL->SetInput(stripper->GetOutput()); //data from vtkStripper<BR>> > writeSTL->Write();<BR>> > --code--<BR>> ><BR>> > but it didn't work. The feet.stl is only 1KB.<BR>> > However, I can see the 3D surface in RenderWindow. I don't konw why.<BR>> > Could any one help me, please?<BR>> ><BR>> > Thanks so much!!!<BR>> ><BR>> > Regards,<BR>> ><BR>> > Danile<BR>> ><BR>> > ________________________________<BR>> > 使用新一代 Windows Live Messenger 轻松交流和共享! 立刻下载!<BR>> > _______________________________________________<BR>> > Powered by www.kitware.com<BR>> ><BR>> > Visit other Kitware open-source projects at<BR>> > http://www.kitware.com/opensource/opensource.html<BR>> ><BR>> > Please keep messages on-topic and check the VTK FAQ at:<BR>> > http://www.vtk.org/Wiki/VTK_FAQ<BR>> ><BR>> > Follow this link to subscribe/unsubscribe:<BR>> > http://www.vtk.org/mailman/listinfo/vtkusers<BR>> ><BR>> ><BR>                                            <br /><hr />使用新一代 Windows Live Messenger 轻松交流和共享! <a href='http://www.windowslive.cn/messenger/' target='_new'>立刻下载!</a></body>
</html>