<div dir="ltr">Evan,<div><br></div><div>I played with your example in ParaView 5.0 RC2 and could not reproduce the crash when setting the celIId to one of the end caps. Do you have a stack trace where the crash occurs, by chance?</div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 2:27 PM, Evan Kao <span dir="ltr"><<a href="mailto:tossin@gmail.com" target="_blank">tossin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hey all,<br></div><div><br>It seems the issue might be something else other than the the neighbor cell type. After applying the Triangulate Filter, the GetCellNeighbors method still results in the same behavior: For cell neighbors on the side of the cylinder, the scripts works, but for cell neighbors that make up the cap, Paraview crashes. So now I have no idea what's happening.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">- Evan<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 11:16 AM, Evan Kao <span dir="ltr"><<a href="mailto:tossin@gmail.com" target="_blank">tossin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>I've been playing around with the GetCellEdgeNeighbors and GetCellNeighbors methods in the vtkPolyData class and testing them on a cylinder source in Paraview 4.3.1, which generates a surface made of vtkQuads for the sides and vtkPolygons for caps. I've applied the Clean filter to the cylinder since the caps generate duplicate points.<br><br></div><div><img style="margin-right:0px" alt="Inline image 1" src="cid:ii_15192767e0ba350d" height="288" width="394"></div><br>Within a programmable filter, I've tested the following script:<br><br></div><div><span style="font-family:monospace,monospace">import numpy as np<br></span></div><div><span style="font-family:monospace,monospace"><br>in1 = self.GetPolyDataInput()<br>surface = self.GetOutput()<br>surface.DeepCopy(in1)<br>surface.BuildCells()<br>surface.BuildLinks()<br><br>cellId = 0 <span style="color:rgb(56,118,29)"># a vtkQuad</span><br>cellPtIds = vtk.vtkIdList()<br>surface.GetCellPoints(cellId, cellPtIds)<br>cellPtIds = [cellPtIds.GetId(i) for i in xrange(cellPtIds.GetNumberOfIds())]<br>cellPtIds = np.array(cellPtIds).astype(np.int64)<br>cellEdges = [[id0, id1] for id0, id1 in zip(cellPtIds[:-1], cellPtIds[1:])]<br>cellEdges.append( [cellPtIds[-1], cellPtIds[0]] )<br><br>edgeId = 0 <span style="color:rgb(56,118,29)"># or 1,2,3</span><br>edge = cellEdges[edgeId]<br><br>edgeIdList = vtk.vtkIdList()<br>for i in xrange(2):<br> edgeIdList.InsertNextId(edge[i]) <br>singleCellEdgeNeighborIds = vtk.vtkIdList()<br><span style="color:rgb(56,118,29)">#surface.GetCellEdgeNeighbors(cellId, edge[0], edge[1], singleCellEdgeNeighborIds)</span><br>surface.GetCellNeighbors(cellId, edgeIdList, singleCellEdgeNeighborIds)</span><br><br></div>If the edge neighbor cell is a vtkQuad, the script works. But if the edge neighbor cell corresponds to one of the caps, Paraview will crash. Is there a way to get this to work?<br><br></div>Thanks,<br></div>Evan Kao<br></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>