Kyle,
Once you get a slice, you can extract the underlying vtkUnstructuredGrid and
use that to extract the connectivity. For example:
uns_grid = servermanager.Fetch(slice)
npts = uns_grid.GetNumberOfCells()
for n in xrange(npts):
ptids = vtk.vtkIdList()
uns_grid.GetCellPoints(0, ptids)
print [ptids.GetId(i) for i in xrange(ptids.GetNumberOfIds())]
And you can interchange the words Point and Cell to get the inverse information
(all of the cells using a given point).
I tried playing around with something along the lines of:
uns_grid.BuildLinks()
links = uns_grid.GetCellLinks()
npts = uns_grid.GetNumberOfPoints()
for i in xrange(npts)
print links.GetCells(i)
but GetCells returns a vtkIdType pointer, which in Python shows up as a string
containing an address in memory. I couldn't figure out how to translate that
back into something meaningful.
Tim
________________________________
From: ParaView <[email protected]> on behalf of Schau, Kyle A
<[email protected]>
Sent: Wednesday, March 1, 2017 12:35 PM
To: [email protected]
Subject: [Paraview] Maintain triangulation of slive from vtk to numpy
Hello All
Does anyone know if the capability exists to extract slice data through the
python interface of paraview that contains the triangulation data of the slice?
This would allow one to pull flattened VTK data in the form of numpy arrays,
but still plot non-convex slice geometries easily with mayplotlib.tricont()
Thanks for your help.
Kyle A. Schau
Graduate Research Assistant
Computational Combustion Lab
Georgia Institute of Technology
Atlanta, GA
(269)-986-4579
_______________________________________________
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 ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview