<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Darshan Pai</b> <span dir="ltr">&lt;<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>&gt;</span><br>
Date: Thu, Mar 8, 2012 at 7:39 PM<br>Subject: Re: [vtkusers] How to save STL file<br>To: Chao Wang &lt;<a href="mailto:buaawangchao@gmail.com">buaawangchao@gmail.com</a>&gt;<br><br><br>Do you have to use VTK ? You can use any graphic editor to do this :)<div>
<br></div><div><br></div><div>But any way , you need to ensure that there are no polygons and only triangular faces. You can use vtkTriangleFilter to convert polygons to triangles</div>
<div><br></div><div>HTH</div><div><br></div><div>Darshan</div><div><br><div class="gmail_quote"><div><div class="h5">On Thu, Mar 8, 2012 at 6:26 PM, Chao Wang <span dir="ltr">&lt;<a href="mailto:buaawangchao@gmail.com" target="_blank">buaawangchao@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>Hey gus,</div>
<div> </div>
<div>I am new to VTK, and trying to conver a OBJ file to a STL file. I tried the following code section, but it didn&#39;t work. It did created a STL file, but with nothing inside, only 1KB. Any help and direction would be appreciated. </div>



<div> </div>
<div>Thanks.</div>
<div>   </div>
<div>   vtkSmartPointer&lt;vtkOBJReader&gt; readerOBJ = vtkSmartPointer&lt;vtkOBJReader&gt;::New();<br>   readerOBJ-&gt;SetFileName(filename.c_str());<br>   readerOBJ-&gt;Update();</div>
<div> </div>
<div>  vtkSmartPointer&lt;vtkSTLWriter&gt; stlWriter = vtkSmartPointer&lt;vtkSTLWriter&gt;::New();<br>  stlWriter-&gt;SetFileName(&quot;Bobcat.stl&quot;);<br>  stlWriter-&gt;SetInputConnection(readerOBJ-&gt;GetOutputPort());<br>


  stlWriter-&gt;Write();<span><font color="#888888"><br><br>-- <br></font></span></div><span><font color="#888888">
<div>Chao Wang<br>Graduate Research Assistant<br>The Durham School of Architectural Engineering and Construction<br>University of Nebraska - Lincoln<br>The Peter Kiewit Institute <br>1110 S. 67th Street 118A</div>
<div>Omaha, NE 68182-0571<font face="arial, sans-serif"><br></font></div><br>
</font></span><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</div><br>