The following presents a fast algorithm for volume computation of a
simple, closed, triangulated 3D mesh. This assumption is a consequence
of the divergence theorem. Further extensions may generalise to other
meshes as well, although that is presently out of scope.
We begin with the definition of volume as the triple integral over a
region of the constant one:
Let𝐅\mathbf{F}be a function inℝ3\mathbb{R}^3such that its divergence is equal to one. For the purposes of this
paper, we choose:
𝐅(x,y,z)=\mathbf{F}(x, y, z) =
div𝐅=∂F∂x+∂F∂y+∂F∂z=1+0+0=1\mathrm{div} \mathbf{F} = \frac{\partial F}{\partial x} + \frac{\partial F}{\partial y} + \frac{\partial F}{\partial z} = 1 + 0 + 0 = 1
V=∭R1dV=∭Rdiv𝐅(x,y,z)dVV = \iiint_R 1 dV = \iiint_R \mathrm{div} \mathbf{F}(x, y, z) \mathrm{d}V
By the Divergence Theorem, this is equal to the surface integral:
V=∬S𝐅(x,y,z)d𝐒V = \iint_S \mathbf{F}(x, y, z) \mathrm{d}\mathbf{S}
This surface integral, defined over the surface S of the 3D mesh, is
equal to the sum of its piecewise triangle parts. LetTiT_idenote the surface of theii’th
triangle in the mesh. Then,
V=∑i=0∬Ti𝐅(x,y,z)d𝐒V = \sum_{i = 0} \iint_{T_i} \mathbf{F}(x, y, z) \mathrm{d}\mathbf{S}
LetTinT_{in}represent thenn’th
vertex of theii’th
triangle. LetΔ1\Delta_1equal the vector difference betweenTi1T_{i1}andTi0T_{i0},
andΔ2\Delta_2likewise equal toTi2−Ti0T_{i2} – T{i0}.
Each individual triangleTiT_imay thus be parametrised as:
𝐫(u,v)=Ti0+uΔ1+vΔ2\mathbf{r}(u, v) = T_{i0} + u\Delta_1 + v\Delta_2