pyvista.CompositeFilters.compute_cell_sizes#

CompositeFilters.compute_cell_sizes(
length=True,
area=True,
volume=True,
progress_bar=False,
vertex_count=False,
)[source]#

Compute sizes for 0D (vertex count), 1D (length), 2D (area) and 3D (volume) cells.

Parameters:
lengthbool, default: True

Specify whether or not to compute the length of 1D cells.

areabool, default: True

Specify whether or not to compute the area of 2D cells.

volumebool, default: True

Specify whether or not to compute the volume of 3D cells.

progress_barbool, default: False

Display a progress bar to indicate progress.

vertex_countbool, default: False

Specify whether or not to compute sizes for vertex and polyvertex cells (0D cells). The computed value is the number of points in the cell.

Returns:
pyvista.DataSet

Dataset with cell_data containing the "VertexCount", "Length", "Area", and "Volume" arrays if set in the parameters. Return type matches input.

Notes

If cells do not have a dimension (for example, the length of hexahedral cells), the corresponding array will be all zeros.

Examples

Compute the face area of the example airplane mesh.

>>> from pyvista import examples
>>> surf = examples.load_airplane()
>>> surf = surf.compute_cell_sizes(length=False, volume=False)
>>> surf.plot(show_edges=True, scalars='Area')
../../../_images/pyvista-CompositeFilters-compute_cell_sizes-1_00_00.png