Cube

Cube(center=(0.0, 0.0, 0.0), x_length=1.0, y_length=1.0, z_length=1.0, bounds=None)

Create a cube.

It’s possible to specify either the center and side lengths or just the bounds of the cube. If bounds are given, all other arguments are ignored.

Parameters
centersequence, optional

Center in [x, y, z].

x_lengthfloat, optional

Length of the cube in the x-direction.

y_lengthfloat, optional

Length of the cube in the y-direction.

z_lengthfloat, optional

Length of the cube in the z-direction.

boundssequence, optional

Specify the bounding box of the cube. If given, all other arguments are ignored. (xMin, xMax, yMin, yMax, zMin, zMax).

Returns
pyvista.PolyData

Mesh of the cube.

Examples

Create a default cube.

>>> import pyvista
>>> mesh = pyvista.Cube()
>>> mesh.plot(show_edges=True, line_width=5)
../../../_images/pyvista-Cube-1_00_00.png