colour.geometry.primitive_vertices_sphere#

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

Generate vertices of a latitude-longitude sphere primitive.

Parameters:
  • radius (float) – Radius of the sphere.

  • segments (int) – Number of latitude-longitude segments. If the intermediate argument is True, the sphere will have one fewer segment along its longitude.

  • intermediate (bool) – Whether to generate sphere vertices at the centres of the faces outlined by the segments of a regular sphere generated without the intermediate argument set to True. The resulting sphere is inscribed within the regular sphere faces while maintaining identical poles.

  • origin (ArrayLike) – Origin of the primitive on the construction plane.

  • axis (Literal['+z', '+x', '+y', 'yz', 'xz', 'xy'] | str) – Axis to which the primitive will be normal, or plane with which the primitive will be co-planar.

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