Given a list of vertices (v
), and a list of edges connecting the vertices (e
), and a list of surfaces that connect the edges (s
), how to calculate the volume of the Polyhedron?
5. b Apply the formulas 𝑉 = 𝑙 × 𝑤 × ℎ and 𝑉 = 𝑏 × ℎ for rectangular prisms to find volumes of right rectangular prisms with whole-number edge lengths in the context of solving real world and mathematical problems.
combinatorics. Euler was the first to investigate in 1752 the analogous question concerning polyhedra. He found that υ − e + f = 2 for every convex polyhedron, where υ, e, and f are the numbers of vertices, edges, and faces of the polyhedron.
We can also find the number of faces in a polyhedron using Euler's formula, F + V - E = 2, if we know the number of edges and vertices.
Notes:
[ x1 x2 x3 x4 ]
[ y1 y2 y3 y4 ]
[ z1 z2 z3 z4 ]
[ 1 1 1 1 ]
where the columns are the homogeneous coordinates of the verticies (x,y,z,1).
It works even if the shape does not enclose the origin by subracting off that volume as well as adding it in, but that depends on having a consistent ordering.
If you can't preserve the order you can still find some way to break it into tetrahedrons and sum 1/6 absolute value of the determinant of each one.
Edit: I'd like to add that for triangle mesh where one vertex (say V4) of the tetrahedron is (0,0,0) the determinante of the 4x4 matrix can be simplified to the upper left 3x3 (expansion along the 0,0,0,1 column) and that can be simplified to Vol = V1xV2.V3 where "x" is cross product and "." is dot product. So compute that expression for every triangle, sum those volumes and divide by 6.
Similarly with a polygon where we can split it into triangles and sum the areas,
you could split a polyhedron into pyramids and sum their volumes. But I'm not sure how hard is to implement an algorithm for that.
(I believe there is a mathematical way/formula, like using vectors and matrices.
I suggest to post your question also on http://mathoverflow.net)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With