compute_cell_sizes

CompositeFilters.compute_cell_sizes(length=True, area=True, volume=True, progress_bar=False)

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

Parameters
lengthbool, optional

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

areabool, optional

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

volumebool, optional

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

progress_barbool, optional

Display a progress bar to indicate progress.

Returns
pyvista.DataSet

Dataset with cell_data containing the "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)
../../../_images/pyvista-CompositeFilters-compute_cell_sizes-1_00_00.png