[Paraview] Extract cell type from unstructured grid

Moreland, Kenneth kmorel at sandia.gov
Wed Feb 18 11:55:36 EST 2009


Paul,

I don't know of any existing filter to do that, but a pretty simple programmable filter can do it.  Here is the script that will achieve it.  Just create a custom filter and copy this into the script.

input = self.GetUnstructuredGridInput() output = self.GetUnstructuredGridOutput() output.GetPointData().PassData(input.GetPointData()) output.GetCellData().PassData(input.GetCellData()) cellTypes = vtk.vtkUnsignedCharArray() cellTypes.DeepCopy(input.GetCellTypesArray()) cellTypes.SetName("Cell Types") output.GetCellData().AddArray(cellTypes)
If you plan to use this multiple times, you probably want to wrap this in a custom filter.

-Ken


On 2/18/09 5:07 AM, "Paul Edwards" <paul.m.edwards at gmail.com> wrote:

Hello,

Does anyone know an easy way to extract all cells of a particular type from an unstructured grid (without writing code either a plugin or python script)?  I was thinking it be possible with the calculator and the number of points in a cell but I can't get access to that.

Thanks,
Paul



   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090218/415ca07f/attachment.htm>


More information about the ParaView mailing list