[vtkusers] Problem with conversion from VRML into VTK file

Baliki baliki balikivtk at gmail.com
Tue Nov 24 05:46:02 EST 2009


I think what you get now is only ONE part of the image.

The problem is that you get only one actor
at line "pDataset = actors.GetNextActor().GetMapper().GetInput()".

Hope that helps.

Baliki



2009/11/24 RimAY <rim.ayari at gmail.com>

>
> Dear All ,
>
> I try to convert a vrml file into vtk file, my problem is that i got only a
> part of the image in the vtk format.
> this is the code i used:
>
> target = vtkVRMLImporter()
> target.SetFileName("WRL path")
> target.Read()
>
> actors = vtkActorCollection()
> actors = target.GetRenderer().GetActors()
> actors.InitTraversal()
>
> pDataset = actors.GetNextActor().GetMapper().GetInput()
>
> geometryFilter = vtkGeometryFilter()
> geometryFilter.SetInput(pDataset)
>
> filter1 = vtkImageDataGeometryFilter()
> filter1.SetInput(pDataset)
>
> data = vtkPolyData()
> data = geometryFilter.GetOutput()
> data.Update()
>
>
> writer = vtkXMLPolyDataWriter()
> writer.SetFileName("vtk path")
> writer.SetInput(data)
> writer.Write()
>
> print "fichier crée"
>
> Any help will be very appreciated
>
> Best Regards
> --
> View this message in context:
> http://old.nabble.com/Problem-with-conversion-from-VRML-into-VTK-file-tp26493224p26493224.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> 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/20091124/0c0552b9/attachment.htm>


More information about the vtkusers mailing list