Centroid of convex polyhedron
问题 I have a closed convex polyhedron which is defined by an array of convex polygons (faces) which are defined by arrays of vertices in 3D space. I'm trying to find the centroid of the polyhedron, assuming uniform density. At the moment I calculate it with the algorithm in this pseudo-code. public Vector3 getCentroid() { Vector3 centroid = (0, 0, 0); for (face in faces) { Vector3 point = face.centroid; point.multiply(face.area()); centroid.add(point); } centroid.divide(faces.size()); return