How to get the centroid of a convex polyhedron?

Rasoul
Posts: 8
Joined: Wed Sep 05, 2012 7:03 pm

How to get the centroid of a convex polyhedron?

Post by Rasoul »

The Class btConvexHullComputer can generate faces of a given set of vertices of a convex-hull in 3D. Is there any implementation in Bullet 2.81 to compute the centroid (center of mass) of the corresponding convex polyhedron (i.e., the convexhull shape computed by btConvexHullComputer)?
Last edited by Rasoul on Tue Oct 01, 2013 3:54 pm, edited 2 times in total.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: How to get centroid of a convex polyhedron?

Post by Dirk Gregorius »

Just add all vertices and divide by the number.
Rasoul
Posts: 8
Joined: Wed Sep 05, 2012 7:03 pm

Re: How to get centroid of a convex polyhedron?

Post by Rasoul »

Dirk Gregorius wrote:Just add all vertices and divide by the number.
That's the average of vertices, I'm looking for the center of mass of the convex polyhedron assuming that the mass distribution is uniform.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: How to get the centroid of a convex polyhedron?

Post by Dirk Gregorius »

Right, sorry! There are a bunch of publications on this and I bet Bullet has an implementation of the either Mirtich's or Eberly's method. Look where it computes the inertia tensor since this also computes the mass center. If not you need to implement this yourself here are some references:

Mirtich: http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html
Eberly: http://www.geometrictools.com/Documenta ... erties.pdf

Personally I use this method:
Kallay: http://www.tandfonline.com/doi/abs/10.1 ... kr1ZoakqGc


HTH,
-Dirk
Rasoul
Posts: 8
Joined: Wed Sep 05, 2012 7:03 pm

Re: How to get the centroid of a convex polyhedron?

Post by Rasoul »

Thanks for the references, in the worst case I have to implement one of the known algorithms by myself.