colour.primitive_vertices#

colour.primitive_vertices(method: Union[Literal['Cube MPL', 'Quad MPL', 'Grid MPL', 'Sphere'], str] = 'Cube MPL', **kwargs: Any) ndarray[source]#

Return the vertices of a geometry primitive using given method.

Parameters:
Returns:

Primitive vertices.

Return type:

numpy.ndarray

Examples

>>> primitive_vertices()
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.]]])
>>> primitive_vertices("Quad MPL")
array([[ 0.,  0.,  0.],
       [ 1.,  0.,  0.],
       [ 1.,  1.,  0.],
       [ 0.,  1.,  0.]])
>>> primitive_vertices("Sphere", segments=4)  
array([[[  0.0000000...e+00,   0.0000000...e+00,   5.0000000...e-01],
        [ -3.5355339...e-01,  -4.3297802...e-17,   3.5355339...e-01],
        [ -5.0000000...e-01,  -6.1232340...e-17,   3.0616170...e-17],
        [ -3.5355339...e-01,  -4.3297802...e-17,  -3.5355339...e-01],
        [ -6.1232340...e-17,  -7.4987989...e-33,  -5.0000000...e-01]],

       [[  0.0000000...e+00,   0.0000000...e+00,   5.0000000...e-01],
        [  2.1648901...e-17,  -3.5355339...e-01,   3.5355339...e-01],
        [  3.0616170...e-17,  -5.0000000...e-01,   3.0616170...e-17],
        [  2.1648901...e-17,  -3.5355339...e-01,  -3.5355339...e-01],
        [  3.7493994...e-33,  -6.1232340...e-17,  -5.0000000...e-01]],

       [[  0.0000000...e+00,   0.0000000...e+00,   5.0000000...e-01],
        [  3.5355339...e-01,   0.0000000...e+00,   3.5355339...e-01],
        [  5.0000000...e-01,   0.0000000...e+00,   3.0616170...e-17],
        [  3.5355339...e-01,   0.0000000...e+00,  -3.5355339...e-01],
        [  6.1232340...e-17,   0.0000000...e+00,  -5.0000000...e-01]],

       [[  0.0000000...e+00,   0.0000000...e+00,   5.0000000...e-01],
        [  2.1648901...e-17,   3.5355339...e-01,   3.5355339...e-01],
        [  3.0616170...e-17,   5.0000000...e-01,   3.0616170...e-17],
        [  2.1648901...e-17,   3.5355339...e-01,  -3.5355339...e-01],
        [  3.7493994...e-33,   6.1232340...e-17,  -5.0000000...e-01]]])