Skip to content
Tech News
← Back to articles

Hilariously Fast Volume Computation with the Divergence Theorem (2018)

read original more articles
Why This Matters

This article introduces a highly efficient algorithm for calculating the volume of a closed, triangulated 3D mesh using the divergence theorem. By transforming the volume computation into a surface integral, it simplifies and accelerates the process, which is valuable for 3D modeling, computer graphics, and simulation applications in the tech industry. This approach enables faster processing of complex geometries, benefiting both developers and consumers relying on real-time 3D rendering and analysis.

Key Takeaways

Hilariously Fast Volume Computation with the Divergence Theorem

(No, there won’t be jokes.)

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:

V = ∭ R 1 d V V = \iiint_R 1 \mathrm{d}V

Let 𝐅 \mathbf{F} be a function in ℝ 3 \mathbb{R}^3 such that its divergence is equal to one. For the purposes of this paper, we choose:

𝐅 ( x , y , z ) = < x , 0 , 0 > \mathbf{F}(x, y, z) = <x, 0, 0>

It can easily be verified that

d i v 𝐅 = ∂ 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

Therefore,

... continue reading