volume#

property PolyData.volume: float#

Return the volume of the dataset.

This will throw a VTK error/warning if not a closed surface.

Returns
float

Total volume of the mesh.

Examples

>>> import pyvista
>>> sphere = pyvista.Sphere()
>>> sphere.volume
0.5183