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
CellTypevalues corresponding to thepyvista.Cell.typeof 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.
Examples#
Download Python source code | Download Jupyter notebook
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>}
See Also#
Used In#
API Examples
CellType.dimension_map(1 use)DataSet.max_cell_dimensionality(1 use)Grid.to_hexahedra(1 use)Grid.to_quads(1 use)Sphere(1 use)UnstructuredGrid.celltypes(1 use)generate_cell_blocks(1 use)
Gallery Examples