The traditional method to determine the volume of a polyhedron partitions it into pyramids, one per face.
Instead of using the origin, you could use one vertex. This means messier code but fewer pyramids. It's probably not worth the bother.
Alternatively, the polyhedron might be partitioned into tetrahedra, with each face partitioned into triangles.
Be careful of signs since some tetrahedra should have negative volumes.
Alternatively only local topological info might be used. Here, the input is a set of tuples derived from vertex-edge-face adjacency info:
where there is one quadruple for each case of a vertex-edge-face adjacency. I.e., for a cube, there are 6 such adjacencies for each vertex, or 48 total.
V | Coordinates of a vertex. |
T | Unit tangent vector from the vertex along the edge towards the other end. |
N | Unit vector normal to the edge in the plane of the face, and pointing from the edge into the face. |
B | Unit vector normal to the plane of the face, and pointing into the polyhedron. |
The formulae are my own. They use no global information about the polyhedron. E.g., there is no concept of an edge as one entity, but only of the directions that the edges leave the vertices.
For more info and the derivation, see the slides of a talk. There are some typos in the slides.
This method is good when the polyhedron has a complicated global topology, with many nested shells of faces and loops of edges.
It's ideal when the polyhedron is being calculated as the output of some process, such as the intersection of two other polyhedra. In fact, you don't need to find the complete intersection polyhedron, but can stop when you have the set of output vertices and their local topology. This saves time and reduces the problems caused by messy topologies.