colour.geometry.primitive_vertices_sphere

colour.geometry.primitive_vertices_sphere(radius=0.5, segments=8, intermediate=False, origin=array([0, 0, 0]), axis='+z')[source]

Returns the vertices of a latitude-longitude sphere primitive.

Parameters
  • radius (numeric, optional) – Sphere radius.

  • segments (numeric, optional) – Latitude-longitude segments, if the intermediate argument is True, then the sphere will have one less segment along its longitude.

  • intermediate (bool, optional) – Whether to generate the sphere vertices at the center of the faces outlined by the segments of a regular sphere generated without the intermediate argument set to True. The resulting sphere is inscribed on the regular sphere faces but possesses the same poles.

  • origin (array_like, optional) – Sphere origin on the construction plane.

  • axis (array_like, optional) – {‘+z’, ‘+x’, ‘+y’, ‘yz’, ‘xz’, ‘xy’}, Axis (or normal of the plane) the poles of the sphere will be aligned with.

Returns

Sphere primitive vertices.

Return type

ndarray

Notes

  • The sphere poles have latitude segments count - 1 co-located vertices.

Examples

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