[vtkusers] How can I save to STL format?

noc hawkingyy at hotmail.com
Fri Jun 4 23:01:51 EDT 2010


Thank u so much!

You're right, The STLWriter only writes triangles. If I use the following code, it works!

--code--

vtkSTLWriter * writeSTL = vtkSTLWriter ::New();
  writeSTL->SetFileName("D:/data/feet1.STL");
  writeSTL->SetInput(marchingcubes->GetOutput());    //data directly from Marching Cubes
  writeSTL->Write();
--code--

 

Thanks again!!!

 

Daniel
 
> Date: Fri, 4 Jun 2010 16:32:00 -0400
> Subject: Re: [vtkusers] How can I save to STL format?
> From: bill.lorensen at gmail.com
> To: hawkingyy at hotmail.com
> CC: vtkusers at vtk.org
> 
> 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
> >
> >
 		 	   		  
_________________________________________________________________
MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取!
http://kaba.msn.com.cn/?k=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100605/06a02458/attachment.htm>


More information about the vtkusers mailing list