Hacker News
Hilariously Fast Volume Computation with the Divergence Theorem
The article derives an O(n) algorithm for computing the volume of a simple closed triangulated mesh by applying the divergence theorem, converting the volume integral into a surface integral that reduces to a closed-form sum over triangle vertices. Each triangle contributes seven additions and three multiplications, allowing a CPU-only implementation to process roughly 30 million triangles per frame at 60 fps on a $35 Raspberry Pi.