<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>