Subject 5.19: How can I compute the volume of a polyhedron?
Assume that the surface is closed, every face is a triangle, and the vertices of each triangle are oriented ccw from the outside. Let Volume(t,p) be the signed volume of the tetrahedron formed by a point p and a triangle t. This may be computed by a 4×4 determinant, as in [O’Rourke, p.26]. Choose an arbitrary point p (e.g., the origin), and compute the sum Volume(t_i,p) for every triangle t_i of the surface. That is the volume of the object. The justification for this claim is nontrivial, but is essentially the same as the justification for the computation of the area of a polygon (Subject 2.01). C Code available at http://cs.smith.edu/~orourke/ and http://www.acm.org/jgt/papers/Mirtich96/ . For computing the volumes of n-d convex polytopes, there is a C implementation by Bueeler and Enge of various algorithms available at| http://www.Mathpool.Uni-Augsburg.DE/~enge/Volumen.html.