Compute the center of mass of a polyhedron.
polyhedron (tuple) – The coordinates of the vertices, and the indices of the vertices forming the faces.
list – XYZ coordinates of the center of mass.
This function assumes that the vertex cycles of the faces are such that the face normals are consistently pointing outwards, resulting in a positive polyhedron.
>>> from compas.geometry import Polyhedron >>> p = Polyhedron.from_platonicsolid(6) >>> centroid_polyhedron(p) [0.0, 0.0, 0.0]