[vtkusers] best way to export a surface and reload it

David Doria daviddoria at gmail.com
Thu May 24 14:15:47 EDT 2012


On Thu, May 24, 2012 at 2:10 PM, João Domingos
<joao.sousa.domingos at gmail.com> wrote:
> Hey all,
>
> I have a closed surface, basically an elipse, defined by:
>
> cf = vtk.vtkContourFilter
> cf.SetInputConnection(surf.GetOutputPort())
> cf.SetNumberOfContours(0)
> cf.SetValue(0,0)
>
> How can I export this cf surface to a file and how can I read it on
> later and simply use it, just as if I had created it?
>
> I took a look at teh vtkOBJExporter and vtkOBJReader, but this saves a
> vtkrenderwindow... not a surface.
>
> Big thanks in advance,
> Joao

The vtkContourFilter outputs a vtkPolyData, so you should use the
vtkXMLPolyDataWriter to write it to a vtp file.

David



More information about the vtkusers mailing list