# Examples from pyvista.CellType.dimension_map
# ============================================

# Common 2D cell types such as `TRIANGLE` and `TRIANGLE_STRIP`
# are in the 2D grouping.
import pyvista as pv
two_d = pv.CellType.dimension_map[2]
pv.CellType.TRIANGLE in two_d
pv.CellType.TRIANGLE_STRIP in two_d

# Check whether a mesh contains only 2D cells by combining this with
# `distinct_cell_types`.
mesh = pv.Sphere()
mesh.distinct_cell_types <= pv.CellType.dimension_map[2]

# Show all 0D cell types.
sorted(pv.CellType.dimension_map[0])

# Show all 1D cell types.
sorted(pv.CellType.dimension_map[1])

# Show all 2D cell types.
sorted(pv.CellType.dimension_map[2])

# Show all 3D cell types.
sorted(pv.CellType.dimension_map[3])

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

