For a closed volume part, one way to do it is to:
- pick a random point as guessed center
- calculate volume of each tetrahedron formed by the point and the triangles of the part
- keep a sum of the multiples of small tetrahedons’ volume and center
- divide the sum by the total volume
Here is an example code.