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]#
Generate vertices of a cube primitive made of grid primitives for use with Matplotlib
mpl_toolkits.mplot3d.art3d.Poly3DCollectionclass.- Parameters:
width (float) – Width of the primitive.
height (float) – Height of the primitive.
depth (float) – Depth of the primitive.
width_segments (int) – Number of width segments defining quad primitive counts along the width axis.
height_segments (int) – Number of height segments defining quad primitive counts along the height axis.
depth_segments (int) – Number of depth segments defining quad primitive counts along the depth axis.
origin (ArrayLike) – Origin of the primitive.
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.]]])