colour.plotting.grid

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