pyvista.examples.cells.BezierHexahedron

pyvista.examples.cells.BezierHexahedron#

BezierHexahedron(*, cell_order: int = 3) UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single Bezier hexahedron.

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

Parameters:
cell_orderint, default: 3

Order of interpolation to use.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single Bezier hexahedron.

Examples

Create and plot a single Bezier hexahedron.

>>> from pyvista import examples
>>> grid = examples.cells.BezierHexahedron()
>>> examples.plot_cell(grid)
../../../_images/pyvista-examples-cells-BezierHexahedron-de52e5792d897dcf_00_00.png

List the grid’s cells.

>>> grid.cells
array([64,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
       16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
       33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
       50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63])

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.        ],
                 [0.33333334, 0.        , 0.        ],
                 [0.66666669, 0.        , 0.        ],
                 [1.        , 0.33333334, 0.        ],
                 [1.        , 0.66666669, 0.        ],
                 [0.33333334, 1.        , 0.        ],
                 [0.66666669, 1.        , 0.        ],
                 [0.        , 0.33333334, 0.        ],
                 [0.        , 0.66666669, 0.        ],
                 [0.33333334, 0.        , 1.        ],
                 [0.66666669, 0.        , 1.        ],
                 [1.        , 0.33333334, 1.        ],
                 [1.        , 0.66666669, 1.        ],
                 [0.33333334, 1.        , 1.        ],
                 [0.66666669, 1.        , 1.        ],
                 [0.        , 0.33333334, 1.        ],
                 [0.        , 0.66666669, 1.        ],
                 [0.        , 0.        , 0.33333334],
                 [0.        , 0.        , 0.66666669],
                 [1.        , 0.        , 0.33333334],
                 [1.        , 0.        , 0.66666669],
                 [1.        , 1.        , 0.33333334],
                 [1.        , 1.        , 0.66666669],
                 [0.        , 1.        , 0.33333334],
                 [0.        , 1.        , 0.66666669],
                 [0.        , 0.33333334, 0.33333334],
                 [0.        , 0.66666669, 0.33333334],
                 [0.        , 0.33333334, 0.66666669],
                 [0.        , 0.66666669, 0.66666669],
                 [1.        , 0.33333334, 0.33333334],
                 [1.        , 0.66666669, 0.33333334],
                 [1.        , 0.33333334, 0.66666669],
                 [1.        , 0.66666669, 0.66666669],
                 [0.33333334, 0.        , 0.33333334],
                 [0.66666669, 0.        , 0.33333334],
                 [0.33333334, 0.        , 0.66666669],
                 [0.66666669, 0.        , 0.66666669],
                 [0.33333334, 1.        , 0.33333334],
                 [0.66666669, 1.        , 0.33333334],
                 [0.33333334, 1.        , 0.66666669],
                 [0.66666669, 1.        , 0.66666669],
                 [0.33333334, 0.33333334, 0.        ],
                 [0.66666669, 0.33333334, 0.        ],
                 [0.33333334, 0.66666669, 0.        ],
                 [0.66666669, 0.66666669, 0.        ],
                 [0.33333334, 0.33333334, 1.        ],
                 [0.66666669, 0.33333334, 1.        ],
                 [0.33333334, 0.66666669, 1.        ],
                 [0.66666669, 0.66666669, 1.        ],
                 [0.33333334, 0.33333334, 0.33333334],
                 [0.66666669, 0.33333334, 0.33333334],
                 [0.33333334, 0.66666669, 0.33333334],
                 [0.66666669, 0.66666669, 0.33333334],
                 [0.33333334, 0.33333334, 0.66666669],
                 [0.66666669, 0.33333334, 0.66666669],
                 [0.33333334, 0.66666669, 0.66666669],
                 [0.66666669, 0.66666669, 0.66666669]])
>>> grid.celltypes  # same as pyvista.CellType.BEZIER_HEXAHEDRON
array([79], dtype=uint8)