pyvista.examples.cells.Voxel

Contents

pyvista.examples.cells.Voxel#

Voxel() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single voxel.

This cell corresponds to the pyvista.CellType.VOXEL cell type.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single voxel.

Examples

Create and plot a single voxel.

>>> from pyvista import examples
>>> grid = examples.cells.Voxel()
>>> examples.plot_cell(grid)

List the grid’s cells.

>>> grid.cells
array([8, 0, 1, 2, 3, 4, 5, 6, 7])

List the grid’s points.

>>> grid.points
pyvista_ndarray([[0., 0., 0.],
                 [1., 0., 0.],
                 [1., 1., 0.],
                 [0., 1., 0.],
                 [0., 0., 1.],
                 [1., 0., 1.],
                 [1., 1., 1.],
                 [0., 1., 1.]])
>>> grid.celltypes  # same as pyvista.CellType.VOXEL
array([11], dtype=uint8)
../../../_images/pyvista-examples-cells-Voxel-1_00_00.png