colour.plotting.geometry Module

Geometry Plotting Utilities

Defines geometry plotting utilities objects:

colour.plotting.geometry.quad(plane='xy', origin=None, width=1, height=1, depth=0)[source]

Returns the vertices of a quad geometric element in counter-clockwise order.

Parameters:
  • plane (array_like, optional) – {‘xy’, ‘xz’, ‘yz’}, Construction plane of the quad.
  • origin (array_like, optional) – Quad origin on the construction plane.
  • width (numeric, optional) – Quad width.
  • height (numeric, optional) – Quad height.
  • depth (numeric, optional) – Quad depth.
Returns:

Quad vertices.

Return type:

ndarray

Examples

>>> quad()
array([[0, 0, 0],
       [1, 0, 0],
       [1, 1, 0],
       [0, 1, 0]])
colour.plotting.geometry.grid(plane='xy', origin=None, width=1, height=1, depth=0, width_segments=1, height_segments=1)[source]

Returns the vertices of a grid made of quads.

Parameters:
  • plane (array_like, optional) – {‘xy’, ‘xz’, ‘yz’}, Construction plane of the grid.
  • origin (array_like, optional) – Grid origin on the construction plane.
  • width (numeric, optional) – Grid width.
  • height (numeric, optional) – Grid height.
  • depth (numeric, optional) – Grid depth.
  • width_segments (int, optional) – Grid segments, quad counts along the width.
  • height_segments (int, optional) – Grid segments, quad counts along the height.
Returns:

Grid vertices.

Return type:

ndarray

Examples

>>> grid(width_segments=2, height_segments=2)
array([[[ 0. ,  0. ,  0. ],
        [ 0.5,  0. ,  0. ],
        [ 0.5,  0.5,  0. ],
        [ 0. ,  0.5,  0. ]],

       [[ 0. ,  0.5,  0. ],
        [ 0.5,  0.5,  0. ],
        [ 0.5,  1. ,  0. ],
        [ 0. ,  1. ,  0. ]],

       [[ 0.5,  0. ,  0. ],
        [ 1. ,  0. ,  0. ],
        [ 1. ,  0.5,  0. ],
        [ 0.5,  0.5,  0. ]],

       [[ 0.5,  0.5,  0. ],
        [ 1. ,  0.5,  0. ],
        [ 1. ,  1. ,  0. ],
        [ 0.5,  1. ,  0. ]]])
colour.plotting.geometry.cube(plane=None, origin=None, width=1, height=1, depth=1, width_segments=1, height_segments=1, depth_segments=1)[source]

Returns the vertices of a cube made of grids.

Parameters:
  • plane (array_like, optional) – Any combination of {‘+x’, ‘-x’, ‘+y’, ‘-y’, ‘+z’, ‘-z’}, Included grids in the cube construction.
  • origin (array_like, optional) – Cube origin.
  • width (numeric, optional) – Cube width.
  • height (numeric, optional) – Cube height.
  • depth (numeric, optional) – Cube depth.
  • width_segments (int, optional) – Cube segments, quad counts along the width.
  • height_segments (int, optional) – Cube segments, quad counts along the height.
  • depth_segments (int, optional) – Cube segments, quad counts along the depth.
Returns:

Cube vertices.

Return type:

ndarray

Examples

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