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