logoalt Hacker News

eterevskytoday at 10:09 AM6 repliesview on HN

Isn't the same as just taking every triangle from the mesh, calculating the volume of a prism-like polytope between it and its projection on one the planes, and then taking it with a + sign if its projection is oriented in one direction, and with a - sign if it's oriented in another? This kind of formula works based on the basic geometry.


Replies

Sharlintoday at 11:11 AM

Yes, this is essentially what the author derived (by means of calculus rather than geometric argument but the result is unsurprisingly the same). The 2D analog is easy to grok: to compute the area of a polygon, find the sum of the signed areas of each of the trapezoids formed by an edge and its projection on the x-axis. Turns out the negative areas of the right-to-left trapezoids cancel precisely out any excess area of the left-to-right trapezoids (or in the case of edges below the x-axis, add precisely the "missing" area).

cgadskitoday at 11:20 AM

Yep. Using the same kind of calculus ideas, I can also think about a vector field that has a Dirac mass of divergence at some point and zero divergence everywhere else. Then you get an expression that you can sum over faces to determine if a polyhedron contains some point. Again, for the right vector field there is a simple geometric interpretation, namely the solid angle that a face makes with respect to the point.

xigoitoday at 10:47 AM

I wonder if this could be reversed to give an intuitive “proof” of the divergence theorem.

show 1 reply
aaa_aaatoday at 10:23 AM

Yes I remember doing something like that in 90s for a survey/map engineering cad application. After delaunay triangulation, calculating approximate voulume is easy. But this probably is a more general solution

show 1 reply
joeltheliontoday at 11:57 AM

> calculating the volume of a prism-like polytope between it and its projection

There is the key insight that you don't need to explicitly compute this projection.

diabllicseagulltoday at 12:20 PM

reminds me of that 1994 paper that reinvented the trapezoidal rule

show 1 reply