celltypes

property UnstructuredGrid.celltypes

Return the cell types array.

Returns
numpy.ndarray

Array of VTK cell types. Some of the most popular cell types:

  • VTK_EMPTY_CELL = 0
  • VTK_VERTEX = 1
  • VTK_POLY_VERTEX = 2
  • VTK_LINE = 3
  • VTK_POLY_LINE = 4
  • VTK_TRIANGLE = 5
  • VTK_TRIANGLE_STRIP = 6
  • VTK_POLYGON = 7
  • VTK_PIXEL = 8
  • VTK_QUAD = 9
  • VTK_TETRA = 10
  • VTK_VOXEL = 11
  • VTK_HEXAHEDRON = 12
  • VTK_WEDGE = 13
  • VTK_PYRAMID = 14
  • VTK_PENTAGONAL_PRISM = 15
  • VTK_HEXAGONAL_PRISM = 16
  • VTK_QUADRATIC_EDGE = 21
  • VTK_QUADRATIC_TRIANGLE = 22
  • VTK_QUADRATIC_QUAD = 23
  • VTK_QUADRATIC_POLYGON = 36
  • VTK_QUADRATIC_TETRA = 24
  • VTK_QUADRATIC_HEXAHEDRON = 25
  • VTK_QUADRATIC_WEDGE = 26
  • VTK_QUADRATIC_PYRAMID = 27
  • VTK_BIQUADRATIC_QUAD = 28
  • VTK_TRIQUADRATIC_HEXAHEDRON = 29
  • VTK_QUADRATIC_LINEAR_QUAD = 30
  • VTK_QUADRATIC_LINEAR_WEDGE = 31
  • VTK_BIQUADRATIC_QUADRATIC_WEDGE = 32
  • VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON = 33
  • VTK_BIQUADRATIC_TRIANGLE = 34
See
https://vtk.org/doc/nightly/html/vtkCellType_8h_source.html
for all cell types.

Examples

This mesh contains only linear hexahedral cells, type vtk.VTK_HEXAHEDRON, which evaluates to 12.

>>> import pyvista
>>> from pyvista import examples
>>> hex_beam = pyvista.read(examples.hexbeamfile)
>>> hex_beam.celltypes  
array([12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
       12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
       12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12],
       dtype=uint8)