DataSet.distinct_cell_types

DataSet.distinct_cell_types#

property DataSet.distinct_cell_types: set[CellType][source]#

Return the set of distinct cell types in this dataset.

The set contains CellType values corresponding to the pyvista.Cell.type of each distinct cell in the dataset.

Warning

Computing distinct cell types can be very slow for complex meshes with VTK version less than 9.6.

Added in version 0.47.

Returns:
set[CellType]

Set of CellType values.

Examples

Load a mesh with linear pyvista.CellType.HEXAHEDRON cells.

>>> from pyvista import examples
>>> hex_beam = examples.load_hexbeam()
>>> hex_beam.distinct_cell_types
{<CellType.HEXAHEDRON: 12>}

Load a mesh with mixed cells.

>>> mesh = examples.download_cow()
>>> sorted(mesh.distinct_cell_types)
[<CellType.TRIANGLE: 5>, <CellType.POLYGON: 7>, <CellType.QUAD: 9>]

Load 2D image.

>>> mesh = examples.load_logo()
>>> mesh.distinct_cell_types
{<CellType.PIXEL: 8>}