# Examples from pyvista.DataObjectFilters.cell_quality
# ====================================================

# Compute and plot the minimum angle of a sample sphere mesh.
import pyvista as pv
sphere = pv.Sphere(theta_resolution=20, phi_resolution=20)
cqual = sphere.cell_quality('min_angle')
cqual.plot(show_edges=True)

# Quality measures like `'volume'` do not apply to 2D cells, and a null value
# of `-1` is returned.
qual = sphere.cell_quality('volume')
qual.get_data_range('volume')

# Compute all valid quality measures for the sphere. These measures all return
# non-null values for `TRIANGLE` cells.
cqual = sphere.cell_quality('all_valid')
valid_measures = cqual.cell_data.keys()
valid_measures

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