[vtkusers] Write several cylinders to a vtp file

David Doria daviddoria at gmail.com
Tue Jul 12 09:21:51 EDT 2011


On Tue, Jul 12, 2011 at 9:13 AM, Oldrich Svec <oldrich.svec at gmail.com>wrote:

> Hi,
>
> I would like to create many cylinders with different positions and
> orientations and save them to the vtp file. So far I managed to create
> vtkCylinderSource but I have problems to rotate it and save it using
> vtkXMLPolyDataWriter. Could you please provide me with a short code
> doing that?
>
> Thank you in advance
> Oldrich
>

You can apply your transform to each object with this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/TransformPolyData

then combine them together with this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/CombinePolydata

then write them with this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP

Good luck,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110712/b66e7449/attachment.htm>


More information about the vtkusers mailing list