colour.geometry.primitive_vertices_cube_mpl#
- colour.geometry.primitive_vertices_cube_mpl(width: float = 1, height: float = 1, depth: float = 1, width_segments: int = 1, height_segments: int = 1, depth_segments: int = 1, origin: ArrayLike = (0, 0, 0), planes: Sequence[Literal['-x', '+x', '-y', '+y', '-z', '+z', 'xy', 'xz', 'yz', 'yx', 'zx', 'zy']] | None = None) NDArrayFloat [source]#
Return the vertices of a cube primitive made of grid primitives for use with Matplotlib
mpl_toolkits.mplot3d.art3d.Poly3DCollection
class.- Parameters:
width (float) – Cube width.
height (float) – Cube height.
depth (float) – Cube depth.
width_segments (int) – Cube segments count along the width.
height_segments (int) – Cube segments count along the height.
depth_segments (int) – Cube segments count along the depth.
origin (ArrayLike) – Cube origin.
planes (Sequence[Literal['-x', '+x', '-y', '+y', '-z', '+z', 'xy', 'xz', 'yz', 'yx', 'zx', 'zy']] | None) – Grid primitives to include in the cube construction.
- Returns:
Cube primitive vertices.
- Return type:
Examples
>>> primitive_vertices_cube_mpl() array([[[ 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., 0., 0.], [ 1., 0., 0.], [ 1., 0., 1.], [ 0., 0., 1.]], [[ 0., 1., 0.], [ 1., 1., 0.], [ 1., 1., 1.], [ 0., 1., 1.]], [[ 0., 0., 0.], [ 0., 1., 0.], [ 0., 1., 1.], [ 0., 0., 1.]], [[ 1., 0., 0.], [ 1., 1., 0.], [ 1., 1., 1.], [ 1., 0., 1.]]])