pyvista.Box

Contents

pyvista.Box#

Box(
bounds: VectorLike[float] = (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0),
level: int = 0,
quads: bool = True,
) PolyData[source]#

Create a box with solid faces for the given bounds.

Parameters:
boundssequence[float], default: (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)

Specify the bounding box of the cube. (x_min, x_max, y_min, y_max, z_min, z_max).

levelint, default: 0

Level of subdivision of the faces.

quadsbool, default: True

Flag to tell the source to generate either a quad or two triangle for a set of four points.

Returns:
pyvista.PolyData

Mesh of the box.

Examples

Create a box with subdivision level=2.

>>> import pyvista as pv
>>> mesh = pv.Box(level=2)
>>> mesh.plot(show_edges=True)
../../../_images/pyvista-Box-1_00_00.png