On Sat, Apr 25, 2009 at 2:03 PM, pat marion <[email protected]> wrote:
> > The only remaining question is why is there no obj support?
> >
> > Thanks,
> >
> > David
>
> There is the vtkOBJReader. It's not in paraview, but you can access
> it from the vtk.io module bundled with paraview.
>
> import paraview.vtk.io as vtkio
>
> # for pv 3.4, use instead: import vtkIOPython as vtkio
> # or on posix, import libvtkIOPython as vtkio
>
> r = vtkio.vtkOBJReader()
> w = vtkio.vtkXMLPolyDataWriter()
> r.SetFileName("/home/pat/porsche.obj")
> w.SetFileName("/home/pat/porsche.vtp")
> w.SetInput(r.GetOutput())
> w.Write()
>
>
> The above code is purely in the vtk world, so you can't mix it with
> things from servermanager, and you can't do things like
> Reader(FileName=foo)
>
> Pat
>
Thanks for the reading obj example, Pat. I looked at dir(vtkio) after
importing it, and it looks like there is an ObjReader, but not an ObjWriter
(makes sense, because I've been wondering the same thing about the missing
objwriter in c++ vtk). How do people generally write obj files from
polydata's?
Thanks,
David
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview