<p>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.</p>
<div class="gmail_quote">On Jun 16, 2012 9:13 AM, "jean mensa" <<a href="mailto:jmensa@rsmas.miami.edu">jmensa@rsmas.miami.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
I am new to vtk and I am struggling reading points from an<br>
unstructured grid. I use a python code that looks like this,<br>
<br>
ugrid = vtk.vtkUnstructuredGrid()<br>
gridreader=vtk.vtkXMLPUnstructuredGridReader()<br>
gridreader.SetFileName(filename)<br>
gridreader.Update()<br>
ugrid=self.gridreader.GetOutput()<br>
<br>
this gives me more points and cells then I would expect,<br>
<br>
ugrid.GetNumberOfCells()<br>
ugrid.GetNumberOfPoints()<br>
<br>
BUT, when I try to get the locations of these points,<br>
<br>
vtkPoints = ugrid.GetPoints()<br>
vtkData = vtkPoints.GetData()<br>
<br>
I find that many of these points are present multiple times.<br>
Why is that?<br>
How do I extract my points once and only once?<br>
<br>
Thank you very much and forgive my ignorance...<br>
j<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>