colour.geometry.hull_section#

colour.geometry.hull_section(hull: trimesh.Trimesh, axis: Literal['+z', '+x', '+y'] | str = '+z', origin: float = 0.5, normalise: bool = False) NDArrayFloat[source]#

Compute the hull section for given axis at given origin.

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

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

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

  • normalise (bool) – 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. ]])