colour.geometry.primitive_vertices_cube_mpl

colour.geometry.primitive_vertices_cube_mpl(width=1, height=1, depth=1, width_segments=1, height_segments=1, depth_segments=1, origin=array([0, 0, 0]), planes=None)[source]

Returns the vertices of a cube primitive made of grid primitives for use with Matplotlib mpl_toolkits.mplot3d.art3d.Poly3DCollection class.

Parameters
  • width (float, optional) – Cube width.

  • height (float, optional) – Cube height.

  • depth (float, optional) – Cube depth.

  • width_segments (int, optional) – Cube segments count along the width.

  • height_segments (float, optional) – Cube segments count along the height.

  • depth_segments (float, optional) – Cube segments count along the depth.

  • origin (array_like, optional) – Cube origin.

  • planes (array_like, optional) – {‘-x’, ‘+x’, ‘-y’, ‘+y’, ‘-z’, ‘+z’, ‘xy’, ‘xz’, ‘yz’, ‘yx’, ‘zx’, ‘zy’}, Grid primitives to include in the cube construction.

Returns

Cube primitive vertices.

Return type

ndarray

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.]]])