[vtkusers] vtkPolyDataWriter in vtkpython

Paulo Henrique Junqueira Amorim paulojamorim at gmail.com
Tue May 12 22:45:23 EDT 2009


Hello,

Have examples in vtk page [1].

[1] - http://www.vtk.org/doc/nightly/html/c2_vtk_t_13.html


import vtk
import time


cone = vtk.vtkConeSource()
cone.SetHeight( 3.0 )
cone.SetRadius( 1.0 )
cone.SetResolution( 10 )
*
#Write in file
w = vtk.vtkPolyDataWriter()
w.SetInput(cone.GetOutput())
w.SetFileName("junk.vtk")
w.Write()*



2009/5/12 Olumide <50295 at web.de>

> Hello,
>
> I would like to create several objects/primitives in the vtkpython, and
>  then write them out as VTK files, without visualizing them. How can I
> accomplish this? I'm not problem I'm having is how to use vtkPolyDataWriter
> in python.
>
> Thanks,
>
> - Olumide
>
>
> ####################### Example #######################
>
>
> #!/usr/bin/env python
>
> import vtk
> import time
>
>
> cone = vtk.vtkConeSource()
> cone.SetHeight( 3.0 )
> cone.SetRadius( 1.0 )
> cone.SetResolution( 10 )




>
> # wite file out using vtkPolyDataWriter
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090512/339e4da7/attachment.htm>


More information about the vtkusers mailing list