pyvista.DataSetFilters.compute_cell_quality#

DataSetFilters.compute_cell_quality(quality_measure='scaled_jacobian', null_value=-1.0, progress_bar=False)[source]#

Compute a function of (geometric) quality for each cell of a mesh.

The per-cell quality is added to the mesh’s cell data, in an array named "CellQuality". Cell types not supported by this filter or undefined quality of supported cell types will have an entry of -1.

Defaults to computing the scaled Jacobian.

Options for cell quality measure:

  • 'area'

  • 'aspect_beta'

  • 'aspect_frobenius'

  • 'aspect_gamma'

  • 'aspect_ratio'

  • 'collapse_ratio'

  • 'condition'

  • 'diagonal'

  • 'dimension'

  • 'distortion'

  • 'jacobian'

  • 'max_angle'

  • 'max_aspect_frobenius'

  • 'max_edge_ratio'

  • 'med_aspect_frobenius'

  • 'min_angle'

  • 'oddy'

  • 'radius_ratio'

  • 'relative_size_squared'

  • 'scaled_jacobian'

  • 'shape'

  • 'shape_and_size'

  • 'shear'

  • 'shear_and_size'

  • 'skew'

  • 'stretch'

  • 'taper'

  • 'volume'

  • 'warpage'

Parameters:
quality_measurestr, default: ‘scaled_jacobian’

The cell quality measure to use.

null_valuefloat, default: -1.0

Float value for undefined quality. Undefined quality are qualities that could be addressed by this filter but is not well defined for the particular geometry of cell in question, e.g. a volume query for a triangle. Undefined quality will always be undefined. The default value is -1.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.DataSet

Dataset with the computed mesh quality in the cell_data as the "CellQuality" array.

Examples

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.compute_cell_quality('min_angle')
>>> cqual.plot(show_edges=True)
../../../_images/pyvista-DataSetFilters-compute_cell_quality-1_00_00.png

See the Computing Mesh Quality for more examples using this filter.