{
  "id": 4076959,
  "title": "Hilariously fast volume computation with the divergence theorem (2018)",
  "url": "https://urgent.news/2026/08/28/hilariously-fast-volume-computation-with-the-divergence-theorem-2018-4076959",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-28T09:00:46.000Z",
  "source": {
    "name": "Hacker News Best",
    "slug": "hacker-news-best",
    "url": "https://alyssarosenzweig.ca/blog/hilariously-fast-volume-computation-with-the-divergence-theorem.html"
  },
  "original_language": "en",
  "account": "The article discusses a fast algorithm for calculating the volume of a simple, closed, triangulated 3D mesh based on the Divergence Theorem. This theorem allows the volume to be calculated as a surface integral over the mesh's triangles. The algorithm begins by defining a function 𝐅 whose divergence is equal to one, which simplifies the volume formula to the sum of surface integrals over each triangle in the mesh.\n\nEach triangle is parametrized and its surface integral is calculated using the cross product of two vectors derived from the triangle's vertices. The X component of the cross product is computed as it is the only non-zero component due to the 𝐅 function. This process results in the volume being expressed as the sum of six terms for each triangle, involving vertex coordinates and their X values.\n\nBy substituting the parametrization and simplifying the integrals, the algorithm reduces to a straightforward loop over the triangles, with each iteration performing basic arithmetic operations (additions, multiplications, and a single division constant). The final formula for the volume is V=16∑i=0(Δi1×Δi2)x(Ti0x+Ti1x+Ti2x), which requires 8n−1 additions and 3n+1 multiplications for n triangles, totaling 11n floating point operations.\n\nThis method is computationally efficient compared to traditional volume computation methods, which often involve rendering and sampling, making it particularly suitable for real-time applications like video games or simulations running on affordable hardware such as a Raspberry Pi. The article concludes by noting that the algorithm's novelty is uncertain, as a similar approach was found in a different paper by Zheng and Chen.",
  "summary": "Article URL: https://alyssarosenzweig.ca/blog/hilariously-fast-volume-computation-with-the-divergence-theorem.html Comments URL: https://news.ycombinator.com/item?id=49476143 Points: 247 # Comments: 65",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "Hacker News",
        "title": "Hilariously Fast Volume Computation with the Divergence Theorem",
        "url": "https://urgent.news/2026/08/28/hilariously-fast-volume-computation-with-the-divergence-theorem",
        "published": "2026-08-28T09:00:46.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}