DataSetFilters.compute_boundary_mesh_quality

DataSetFilters.compute_boundary_mesh_quality#

DataSetFilters.compute_boundary_mesh_quality(*, progress_bar: bool = False) → PolyData[source]#

Compute metrics on the boundary faces of a mesh.

Changed in version 0.50: Input without 3D cells now raises ValueError. Previously an empty PolyData was returned.

The metrics that can be computed on the boundary faces of the mesh and are:

  • Distance from cell center to face center

  • Distance from cell center to face plane

  • Angle of faces plane normal and cell center to face center vector

Parameters:
progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.PolyData

Boundary faces of the 3D cells, with the computed metrics in cell_data.

Raises:
ValueError

If the input has no 3D cells.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> from pyvista import examples
>>> mesh = examples.download_can_crushed_vtu()
>>> cqual = mesh.compute_boundary_mesh_quality()
>>> pl = pv.Plotter(shape=(2, 2))
>>> _ = pl.add_mesh(mesh, show_edges=True)
>>> pl.subplot(1, 0)
>>> _ = pl.add_mesh(cqual, scalars='DistanceFromCellCenterToFaceCenter')
>>> pl.subplot(0, 1)
>>> _ = pl.add_mesh(cqual, scalars='DistanceFromCellCenterToFacePlane')
>>> pl.subplot(1, 1)
>>> _ = pl.add_mesh(
...     cqual,
...     scalars='AngleFaceNormalAndCellCenterToFaceCenterVector',
... )
>>> pl.show()
../../../_images/pyvista-DataSetFilters-compute_boundary_mesh_quality-8138022db2e611a2_00_00.png