<div dir="ltr">Hi kenichiro,<div><br></div><div> Thanks for the reply. I have a problem reading the .vtk file .Below is the code which I had used to read .vtk</div><div><br></div><div><br></div><div><div style="font-size:12.8px"><div>vtkSmartPointer<<wbr>vtkGenericDataObjectReader> reader = </div><div> vtkSmartPointer<<wbr>vtkGenericDataObjectReader>::<wbr>New();</div><div> std::cout<<"filename:"<<argv[<wbr>1]<<"\n";</div><div> reader->SetFileName(argv[1]);</div><div> </div><div> </div><div> reader->Update();</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> I am getting an error: error reading ascii file.possible mismatch of datasize with declaration. How do I fix this?</div><div style="font-size:12.8px">-swetha</div><br><div class="gmail_quote"><div dir="ltr">On Sat, 29 Jul 2017, 11:33 kenichiro yoshimi, <<a href="mailto:rccm.kyoshimi@gmail.com" target="_blank">rccm.kyoshimi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Swetha,<br>
<br>
Assuming that your data is a triangle polydata set, all vtkSTLWriter<br>
have to do is set the file type to binary, so as to output as binary<br>
STL file. You don't need to call WriteBinarySTL(). Ex:<br>
<br>
vtkSmartPointer<vtkSTLWriter> stlWriter =<br>
vtkSmartPointer<vtkSTLWriter>:<wbr>:New();<br>
stlWriter->SetFileName(filenam<wbr>e.c_str());<br>
stlWriter->SetInputData(polyDa<wbr>ta);<br>
stlWriter->SetFileTypeToBinary<wbr>();<br>
stlWriter->Write();<br>
<br>
Thanks<br>
<br>
2017-07-27 23:40 GMT+09:00 Swetha Sharma <<a href="mailto:swetha.bsharma@gmail.com" target="_blank">swetha.bsharma@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I have .vtk file which i want to read and convert to binary stl file. The<br>
> documentation has a function<br>
> WriteBinarySTL (vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips) .<br>
> How do I get the information about the vtkpoints and the cellarray?<br>
><br>
><br>
><br>
> -swetha<br>
> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
><br>
</blockquote></div></div></div>