# Volume of a polyhedron

This topic is 2470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello,
I have to make a project for my university in C++. I use visual studio 2010.
In a part of that project I need to calculate the volume of polyhedrons.
Is there any algorithm for that or any example, which it could help me?
I have already calculated the edges and the vertices of my polyhedron, and draw it with directX.
But how can I calculate the polyhedron's volume?
Any help would be very appreciated cause I'm not so experienced programmer and I have short deadline.
With regards,
Dimitris

##### Share on other sites
i guess you can split the surface into triangles. then choose a point inside the polyhedron and all triangles + that point give you tetrahedrons which have easy to calculate volume and over which you can do a summation.

##### Share on other sites
Yes, I have the triangle list!! And because my polyhedron is convex-yes the solution you suggested to me is perfect!!
Thank you again!!

##### Share on other sites
As a sidenote: if i remember correctly it actually even works with arbitrary points (even outside the polyhedron) and nonconvex shapes if you do "signed" volumes and are careful with the orientation of your triangles/tetrahedrons.

##### Share on other sites

As a sidenote: if i remember correctly it actually even works with arbitrary points (even outside the polyhedron) and nonconvex shapes if you do "signed" volumes and are careful with the orientation of your triangles/tetrahedrons.

Yes, this works. In particular, you can take the point to be the origin, and then the volume is just the sum of the determinants of the 3x3 matrices formed by the coordinates of the three points of each face, divided by 6. If you have non-triangular faces, just divide them up into triangles (and you can do this in some naive way ignoring possible concavities, and it will still work).

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633694
• Total Posts
3013378
×