[vtkusers] vtkSTLWriter, WriteBinarySTL

Jeremy Winston jbw at ieee.org
Thu Apr 14 07:58:26 EDT 2005


TKB 3. Prakt. Corina Farcas wrote:
> Hello vtkusers!
> 
> I have a litte problem: I am trying to write an STL file as a binary 
> File and I dont know what Parameter I need for the Function WriteBinarySTL:
> ...
> vtkSTLWriter *stl = vtkSTLWriter::New();
> stl->SetInput((vtkPolyData*) contour->GetOUtput());
> stl->SetFileName("test.stl");
> stl->WriteBinarySTL(pts, polys);
>                      ??    ??

You don't need to call WriteBinarySTL() directly;
all you have to do is set the file type to binary,
and then invoke the Write() method:

   stl->SetFileTypeToBinary();
   stl->Write()

Write() extracts the points & polys from the polydata
input to STLWriter.

HTH,
-Jeremy



More information about the vtkusers mailing list