pyvista.ImageData.max_cell_dimensionality#
- property ImageData.max_cell_dimensionality: _Dimensionality[source]#
Return the maximum spatial dimensionality of all cells in this mesh.
Added in version 0.47.
- Returns:
intThe maximum dimensionality of the dataset’s cells.
See also
Notes
is always
0forPointSetranges from
0to2forPolyData.ranges from
0to3for all other mesh types.is equivalent to
dimensionalityfor gridded data typesImageDataandRectilinearGrid.
Examples
PointSethas no cells, so itsmax_cell_dimensionalityis always0.>>> import pyvista as pv >>> from pyvista import examples >>> mesh = pv.Sphere().cast_to_pointset() >>> mesh.max_cell_dimensionality 0
A
PolyDatasurface mesh with 2D polygonal cells such asSphere()has max cell dimensionality of2.>>> mesh = pv.Sphere() >>> mesh.max_cell_dimensionality 2
Since there are no 1D
LINEor 0DVERTEXcells, themin_cell_dimensionalityis also2in this case.>>> mesh.min_cell_dimensionality 2
A
UnstructuredGridwith 3D cells such asSolidSphere()has max and min cell dimensionality of3.>>> mesh = pv.SolidSphere() >>> mesh.max_cell_dimensionality 3 >>> mesh.min_cell_dimensionality 3
A
Line()orSpline()with 1D cells has a max and min cell dimensionality of1.>>> mesh = pv.Line([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]) >>> mesh.max_cell_dimensionality 1 >>> mesh.min_cell_dimensionality 1
A curvilinear
StructuredGridsuch as the one fromdownload_wavy()has 2D cells.>>> mesh = examples.download_wavy()[0] >>> mesh.max_cell_dimensionality 2 >>> mesh.min_cell_dimensionality 2
But it has a spatial
dimensionalityof3since its points span three dimensions.>>> mesh.dimensionality 3
The dimensionality can vary if there are mixed cell types. E.g. load
download_prostar().>>> mesh = examples.download_prostar() >>> sorted(mesh.distinct_cell_types) [<CellType.VERTEX: 1>, <CellType.LINE: 3>, <CellType.TRIANGLE: 5>, <CellType.POLYGON: 7>, <CellType.QUAD: 9>, <CellType.TETRA: 10>, <CellType.HEXAHEDRON: 12>, <CellType.WEDGE: 13>, <CellType.PYRAMID: 14>, <CellType.POLYHEDRON: 42>]
There are 3D volumetric cells, so the max dimensionality is
3.>>> mesh.max_cell_dimensionality 3
And since there are
VERTEXcells itsmin_cell_dimensionalityis0.>>> mesh.min_cell_dimensionality 0