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 3D meshes using the divergence theorem, which simplifies the process by converting volume calculations into surface integrals. This advancement can significantly speed up 3D modeling, rendering, and analysis tasks in the tech industry, benefiting both developers and consumers by enabling faster and more accurate geometric computations.

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