colour.primitive_vertices#
- colour.primitive_vertices(method: Literal['Cube MPL', 'Quad MPL', 'Grid MPL', 'Sphere'] | str = 'Cube MPL', **kwargs: Any) NDArrayFloat [source]#
Return the vertices of a geometry primitive using given method.
- Parameters:
method (Literal['Cube MPL', 'Quad MPL', 'Grid MPL', 'Sphere'] | str) – Vertices generation method.
axis – {
colour.geometry.primitive_vertices_quad_mpl()
,colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_sphere()
}, {‘+z’, ‘+x’, ‘+y’, ‘yz’, ‘xz’, ‘xy’}, Axis the primitive will be normal to, or plane the primitive will be co-planar with.depth – {
colour.geometry.primitive_vertices_quad_mpl()
,colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive depth.depth_segments – {
colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive depth segments, quad primitive counts along the depth.height – {
colour.geometry.primitive_vertices_quad_mpl()
,colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive height.height_segments – {
colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive height segments, quad primitive counts along the height.intermediate – {
colour.geometry.primitive_vertices_sphere()
}, Whether to generate the sphere vertices at the center of the faces outlined by the segments of a regular sphere generated without theintermediate
argument set to True. The resulting sphere is inscribed on the regular sphere faces but possesses the same poles.origin – {
colour.geometry.primitive_vertices_quad_mpl()
,colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
,colour.geometry.primitive_vertices_sphere()
}, Primitive origin on the construction plane.planes – {
colour.geometry.primitive_vertices_cube_mpl()
}, {‘-x’, ‘+x’, ‘-y’, ‘+y’, ‘-z’, ‘+z’, ‘xy’, ‘xz’, ‘yz’, ‘yx’, ‘zx’, ‘zy’}, Included grid primitives in the cube construction.radius – {
colour.geometry.primitive_vertices_sphere()
}, Sphere radius.segments – {
colour.geometry.primitive_vertices_sphere()
}, Latitude-longitude segments, if theintermediate
argument is True, then the sphere will have one less segment along its longitude.width – {
colour.geometry.primitive_vertices_quad_mpl()
,colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive width.width_segments – {
colour.geometry.primitive_vertices_grid_mpl()
,colour.geometry.primitive_vertices_cube_mpl()
}, Primitive width segments, quad primitive counts along the width.kwargs (Any) –
- Returns:
Primitive vertices.
- Return type:
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]]])