[vtkusers] too many points extracted from an unstructured grid

jean mensa jmensa at rsmas.miami.edu
Sat Jun 16 11:47:39 EDT 2012


great, It does the job in paraview! but I am not sure how to implement
this in my code... is this a question for the paraview mailing list?
thank you for helping!
j

On Sat, Jun 16, 2012 at 10:17 PM, David E DeMarle
<dave.demarle at kitware.com> wrote:
> 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



More information about the vtkusers mailing list