colour.geometry.hull_section#

colour.geometry.hull_section(hull: trimesh.Trimesh, axis: Union[Literal['+z', '+x', '+y'], str] = '+z', origin: Floating = 0.5, normalise: Boolean = False) NDArray[source]#

Compute the hull section for given axis at given origin.

Parameters
  • hull (trimesh.Trimesh) – Trimesh hull.

  • axis (Union[Literal[('+z', '+x', '+y')], str]) – Axis the hull section will be normal to.

  • origin (Floating) – Coordinate along axis at which to plot the hull section.

  • normalise (Boolean) – Whether to normalise axis to the extent of the hull along it.

Returns

Hull section vertices.

Return type

numpy.ndarray

Examples

>>> from colour.geometry import primitive_cube
>>> from colour.utilities import is_trimesh_installed
>>> vertices, faces, outline = primitive_cube(1, 1, 1, 2, 2, 2)
>>> if is_trimesh_installed:
...     import trimesh
...     hull = trimesh.Trimesh(vertices['position'], faces, process=False)
...     hull_section(hull, origin=0)
array([[-0. , -0.5,  0. ],
       [ 0.5, -0.5,  0. ],
       [ 0.5,  0. , -0. ],
       [ 0.5,  0.5, -0. ],
       [-0. ,  0.5,  0. ],
       [-0.5,  0.5,  0. ],
       [-0.5,  0. , -0. ],
       [-0.5, -0.5, -0. ],
       [-0. , -0.5,  0. ]])