[vtkusers] too many points extracted from an unstructured grid

David E DeMarle dave.demarle at kitware.com
Sat Jun 16 10:17:47 EDT 2012


The duplicate points were produced by whatever wrote the file. Use the
vtkCleanUnstructuredGrid filter from ParaView to get rid of the duplicates.
Or open the file in ParaView, apply the clean to grid filter, save the
data, and open that in your program.
On Jun 16, 2012 9:13 AM, "jean mensa" <jmensa at rsmas.miami.edu> wrote:

> Hi all,
> I am new to vtk and I am struggling reading points from an
> unstructured grid. I use a python code that looks like this,
>
> ugrid = vtk.vtkUnstructuredGrid()
> gridreader=vtk.vtkXMLPUnstructuredGridReader()
> gridreader.SetFileName(filename)
> gridreader.Update()
> ugrid=self.gridreader.GetOutput()
>
> this gives me more points and cells then I would expect,
>
> ugrid.GetNumberOfCells()
> ugrid.GetNumberOfPoints()
>
> BUT, when I try to get the locations of these points,
>
> vtkPoints = ugrid.GetPoints()
> vtkData = vtkPoints.GetData()
>
> I find that many of these points are present multiple times.
> Why is that?
> How do I extract my points once and only once?
>
> Thank you very much and forgive my ignorance...
> j
> _______________________________________________
> 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/20120616/f8188a7b/attachment.htm>


More information about the vtkusers mailing list