<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Kyle,</p>
<p><br>
</p>
<p>Once you get a slice, you can extract the underlying vtkUnstructuredGrid and use that to extract the connectivity. For example:</p>
<p><br>
</p>
<p>uns_grid = servermanager.Fetch(slice)<br>
</p>
<br>
<p>npts = uns_grid.GetNumberOfCells()</p>
<p><br>
</p>
<p>for n in xrange(npts):</p>
<p> ptids = vtk.vtkIdList()</p>
<p> uns_grid.GetCellPoints(0, ptids)</p>
<p> print [ptids.GetId(i) for i in xrange(ptids.GetNumberOfIds())]</p>
<p><br>
</p>
<p>And you can interchange the words Point and Cell to get the inverse information (all of the cells using a given point).
<br>
</p>
<p><br>
</p>
<p>I tried playing around with something along the lines of:</p>
<p><br>
</p>
<p>uns_grid.BuildLinks()</p>
<p>links = uns_grid.GetCellLinks()</p>
<p>npts = uns_grid.GetNumberOfPoints()</p>
<p><br>
</p>
<p>for i in xrange(npts)</p>
<p> print links.GetCells(i)</p>
<p><br>
</p>
<p>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.
<br>
</p>
<br>
<p>Tim</p>
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> ParaView <paraview-bounces@paraview.org> on behalf of Schau, Kyle A <kschau@gatech.edu><br>
<b>Sent:</b> Wednesday, March 1, 2017 12:35 PM<br>
<b>To:</b> paraview@paraview.org<br>
<b>Subject:</b> [Paraview] Maintain triangulation of slive from vtk to numpy</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello All</p>
<p><br>
</p>
<p>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()</p>
<p><br>
</p>
<p>Thanks for your help.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-size:11pt">Kyle A. Schau</span></p>
<p><br>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><span style="font-size:10pt">Graduate Research Assistant</span><br>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span></i></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><br>
<span style="font-size:10pt"></span></i></p>
<span style="font-size:10pt"></span>
<p><i><span style="font-size:10pt">Computational Combustion Lab</span><br>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span></i></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><span style="font-size:10pt">Georgia Institute of Technology</span></i></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><span style="font-size:10pt">Atlanta, GA</span></i></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><br>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span></i></p>
<span style="font-size:10pt"></span><span style="font-size:11pt"></span><span style="font-size:10pt"></span>
<p><i><span style="font-size:10pt">(269)-986-4579</span></i><br>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>