pyvista.CompositeFilters.compute_cell_sizes#
- CompositeFilters.compute_cell_sizes(length=True, area=True, volume=True, progress_bar=False)[source]#
Compute sizes for 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.
- lengthbool, default:
- 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, scalars='Area')