pyvista.CellType#

enum CellType(value)[source]#

Define types of cells.

Notes

See vtkCellType.h for all cell types.

Examples

Create a single cube. Notice how the cell type is defined using the CellType.

>>> import numpy as np
>>> from pyvista import CellType
>>> import pyvista as pv
>>> cells = np.array([8, 0, 1, 2, 3, 4, 5, 6, 7])
>>> cell_type = np.array([CellType.HEXAHEDRON], np.int8)
>>> points = np.array(
...     [
...         [0, 0, 0],
...         [1, 0, 0],
...         [1, 1, 0],
...         [0, 1, 0],
...         [0, 0, 1],
...         [1, 0, 1],
...         [1, 1, 1],
...         [0, 1, 1],
...     ],
...     dtype=np.float32,
... )
>>> grid = pv.UnstructuredGrid(cells, cell_type, points)
>>> grid
UnstructuredGrid (...)
  N Cells:    1
  N Points:   8
  X Bounds:   0.000e+00, 1.000e+00
  Y Bounds:   0.000e+00, 1.000e+00
  Z Bounds:   0.000e+00, 1.000e+00
  N Arrays:   0
Member Type:

int

Valid values are as follows:

EMPTY_CELL = <CellType.EMPTY_CELL: 0>#
VERTEX = <CellType.VERTEX: 1>#
POLY_VERTEX = <CellType.POLY_VERTEX: 2>#
LINE = <CellType.LINE: 3>#
POLY_LINE = <CellType.POLY_LINE: 4>#
TRIANGLE = <CellType.TRIANGLE: 5>#
TRIANGLE_STRIP = <CellType.TRIANGLE_STRIP: 6>#
POLYGON = <CellType.POLYGON: 7>#
PIXEL = <CellType.PIXEL: 8>#
QUAD = <CellType.QUAD: 9>#
TETRA = <CellType.TETRA: 10>#
VOXEL = <CellType.VOXEL: 11>#
HEXAHEDRON = <CellType.HEXAHEDRON: 12>#
WEDGE = <CellType.WEDGE: 13>#
PYRAMID = <CellType.PYRAMID: 14>#
PENTAGONAL_PRISM = <CellType.PENTAGONAL_PRISM: 15>#
HEXAGONAL_PRISM = <CellType.HEXAGONAL_PRISM: 16>#
QUADRATIC_EDGE = <CellType.QUADRATIC_EDGE: 21>#
QUADRATIC_TRIANGLE = <CellType.QUADRATIC_TRIANGLE: 22>#
QUADRATIC_QUAD = <CellType.QUADRATIC_QUAD: 23>#
QUADRATIC_POLYGON = <CellType.QUADRATIC_POLYGON: 36>#
QUADRATIC_TETRA = <CellType.QUADRATIC_TETRA: 24>#
QUADRATIC_HEXAHEDRON = <CellType.QUADRATIC_HEXAHEDRON: 25>#
QUADRATIC_WEDGE = <CellType.QUADRATIC_WEDGE: 26>#
QUADRATIC_PYRAMID = <CellType.QUADRATIC_PYRAMID: 27>#
BIQUADRATIC_QUAD = <CellType.BIQUADRATIC_QUAD: 28>#
TRIQUADRATIC_HEXAHEDRON = <CellType.TRIQUADRATIC_HEXAHEDRON: 29>#
TRIQUADRATIC_PYRAMID = <CellType.TRIQUADRATIC_PYRAMID: 37>#
QUADRATIC_LINEAR_QUAD = <CellType.QUADRATIC_LINEAR_QUAD: 30>#
QUADRATIC_LINEAR_WEDGE = <CellType.QUADRATIC_LINEAR_WEDGE: 31>#
BIQUADRATIC_QUADRATIC_WEDGE = <CellType.BIQUADRATIC_QUADRATIC_WEDGE: 32>#
BIQUADRATIC_QUADRATIC_HEXAHEDRON = <CellType.BIQUADRATIC_QUADRATIC_HEXAHEDRON: 33>#
BIQUADRATIC_TRIANGLE = <CellType.BIQUADRATIC_TRIANGLE: 34>#
CUBIC_LINE = <CellType.CUBIC_LINE: 35>#
CONVEX_POINT_SET = <CellType.CONVEX_POINT_SET: 41>#
POLYHEDRON = <CellType.POLYHEDRON: 42>#
PARAMETRIC_CURVE = <CellType.PARAMETRIC_CURVE: 51>#
PARAMETRIC_SURFACE = <CellType.PARAMETRIC_SURFACE: 52>#
PARAMETRIC_TRI_SURFACE = <CellType.PARAMETRIC_TRI_SURFACE: 53>#
PARAMETRIC_QUAD_SURFACE = <CellType.PARAMETRIC_QUAD_SURFACE: 54>#
PARAMETRIC_TETRA_REGION = <CellType.PARAMETRIC_TETRA_REGION: 55>#
PARAMETRIC_HEX_REGION = <CellType.PARAMETRIC_HEX_REGION: 56>#
HIGHER_ORDER_EDGE = <CellType.HIGHER_ORDER_EDGE: 60>#
HIGHER_ORDER_TRIANGLE = <CellType.HIGHER_ORDER_TRIANGLE: 61>#
HIGHER_ORDER_QUAD = <CellType.HIGHER_ORDER_QUAD: 62>#
HIGHER_ORDER_POLYGON = <CellType.HIGHER_ORDER_POLYGON: 63>#
HIGHER_ORDER_TETRAHEDRON = <CellType.HIGHER_ORDER_TETRAHEDRON: 64>#
HIGHER_ORDER_WEDGE = <CellType.HIGHER_ORDER_WEDGE: 65>#
HIGHER_ORDER_PYRAMID = <CellType.HIGHER_ORDER_PYRAMID: 66>#
HIGHER_ORDER_HEXAHEDRON = <CellType.HIGHER_ORDER_HEXAHEDRON: 67>#
LAGRANGE_CURVE = <CellType.LAGRANGE_CURVE: 68>#
LAGRANGE_TRIANGLE = <CellType.LAGRANGE_TRIANGLE: 69>#
LAGRANGE_QUADRILATERAL = <CellType.LAGRANGE_QUADRILATERAL: 70>#
LAGRANGE_TETRAHEDRON = <CellType.LAGRANGE_TETRAHEDRON: 71>#
LAGRANGE_HEXAHEDRON = <CellType.LAGRANGE_HEXAHEDRON: 72>#
LAGRANGE_WEDGE = <CellType.LAGRANGE_WEDGE: 73>#
LAGRANGE_PYRAMID = <CellType.LAGRANGE_PYRAMID: 74>#
BEZIER_CURVE = <CellType.BEZIER_CURVE: 75>#
BEZIER_TRIANGLE = <CellType.BEZIER_TRIANGLE: 76>#
BEZIER_QUADRILATERAL = <CellType.BEZIER_QUADRILATERAL: 77>#
BEZIER_TETRAHEDRON = <CellType.BEZIER_TETRAHEDRON: 78>#
BEZIER_HEXAHEDRON = <CellType.BEZIER_HEXAHEDRON: 79>#
BEZIER_WEDGE = <CellType.BEZIER_WEDGE: 80>#
BEZIER_PYRAMID = <CellType.BEZIER_PYRAMID: 81>#