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 emptyPolyDatawas 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:
- Returns:
pyvista.PolyDataBoundary faces of the 3D cells, with the computed metrics in
cell_data.
- Raises:
ValueErrorIf 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()