pyvista.RectilinearGrid.dimensions#

property RectilinearGrid.dimensions: Tuple[int, int, int][source]#

Return the grid’s dimensions.

These are effectively the number of points along each of the three dataset axes.

Returns:
tuple[int]

Dimensions of the grid.

Examples

Create a uniform grid with dimensions (1, 2, 3).

>>> import pyvista as pv
>>> grid = pv.ImageData(dimensions=(2, 3, 4))
>>> grid.dimensions
(2, 3, 4)
>>> grid.plot(show_edges=True)
https://d33wubrfki0l68.cloudfront.net/9bb866c6875d5e013b61c52c1ac675e84b1b4c89/0bfb3/_images/pyvista-rectilineargrid-dimensions-1_00_00.png

Set the dimensions to (3, 4, 5)

>>> grid.dimensions = (3, 4, 5)
>>> grid.plot(show_edges=True)
https://d33wubrfki0l68.cloudfront.net/eddad7db5ec94432cc5766cec0baa977dddaf4d7/eb866/_images/pyvista-rectilineargrid-dimensions-1_01_00.png