1

How can I calculate the volume of complex objects based on vector product. I have list of triangles that construct the object mesh.

I have a :

  • list of triangles.
  • a triangle is composed by 3 Nodes.
  • a Node have x,y and z coordinate.
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ali
  • 11
  • 1
  • http://stackoverflow.com/questions/1406029/how-to-calculate-the-volume-of-a-3d-mesh-object-the-surface-of-which-is-made-up-t – nlucaroni Apr 16 '11 at 20:57
  • 2
    ;-) Fully immerge the object in a container that has vertical walls, a regular base (as this simplifies calculations), and which is partially filled with water; by measuring the difference of water levels, the calculation of the volume of a funky shaped object maps to that of a simple solid. ;-) – mjv Apr 16 '11 at 21:04

1 Answers1

3

You can select one point P (for example, origin) and then calculate volumes of all tetrahedrons PABC, where A, B and C are vertices of a triangle from a list. The volume of each such tetrahedron equals abs(((PA x PB) . PC) / 2), where "x" and "." are cross product and dot product respectively and abs is an absolute value. To calculate the volume of the entire object you can sum up all volumes but without taking the absolute value of each. Thus, volumes of some tetrahedrons will be taken with the plus in the sum, and some with the minus. So, the volume of the entire object will be abs(sum(((PAi x PBi) . PCi) / 2)), where Ai, Bi, Ci are vertices of the ith triangle and sum is taken for all i.

fdermishin
  • 3,519
  • 3
  • 24
  • 45