colour.geometry.primitive_vertices_sphere

colour.geometry.primitive_vertices_sphere(radius: float = 0.5, segments: int = 8, intermediate: bool = False, origin: ArrayLike = np.array([0, 0, 0]), axis: Union[Literal['+z', '+x', '+y', 'yz', 'xz', 'xy'], str] = '+z') numpy.ndarray[source]

Return the vertices of a latitude-longitude sphere primitive.

Parameters
  • radius (float) – Sphere radius.

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

  • intermediate (bool) – 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 (ArrayLike) – Sphere origin on the construction plane.

  • axis (Union[Literal['+z', '+x', '+y', 'yz', 'xz', 'xy'], str]) – Axis (or normal of the plane) the poles of the sphere will be aligned with.

Returns

Sphere primitive vertices.

Return type

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