[vtkusers] How to write a polydata into a vtk file

Wenlong Wang scc.wwl at gmail.com
Thu Dec 8 10:39:51 EST 2011


Dear all

I'm trying to write my polydata object into a *.vtk file.

The polydata object has point data, polygon data and texture coordinates.

Here is what I do with vtkGenericDataObjectWriter

vtkGenericDataObjectWriter* writer = vtkGenericDataObjectWriter::New();
writer->SetFileName("C:\\Users\\User1\\Desktop\\newpolydata.vtk");
writer->SetInput(polydata);          //polydata is my polydata object
writer->Update();

But this asctually gives me nothing. No vtk file was generated.

Can anyone tell me what is wrong with my code? If it is totally wrong,
would you please write a simple demo?

Thank you very much.

Best Regards
Wenlong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111208/2714e21a/attachment.htm>


More information about the vtkusers mailing list