计算多面体体积的通用公式 [英] General Formula to Calculate Polyhedron Volume

查看:691
本文介绍了计算多面体体积的通用公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出一个顶点列表(v),一个连接顶点的边列表(e)和一个连接边的表面列表(s),如何计算多面体?

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?

推荐答案

  1. 采用多边形并将其分成三角形.
  2. 考虑由每个三角形和任意点(原点)形成的四面体.
  3. 对这些四面体的符号体积求和.

注意:

  1. 仅当您从外部观察时,可以对三角形保持一致的CW或CCW顺序时,这才有用.
  2. 四面体的有符号体积等于以下矩阵的行列式的1/6:

[x1 x2 x3 x4]
[y1 y2 y3 y4]
[z1 z2 z3 z4]
[1 1 1 1]

[ x1 x2 x3 x4 ]
[ y1 y2 y3 y4 ]
[ z1 z2 z3 z4 ]
[ 1 1 1 1 ]

其中列是折点(x,y,z,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.

如果无法保留该顺序,您仍然可以找到某种方法将其分解为四面体,并将每个行列式的行列式的绝对值相加1/6.

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.

我想补充一点,对于四面体的一个顶点(例如V4)为(0,0,0)的三角形网格,可以将4x4矩阵的行列式简化为左上3x3(沿0,0展开, 0,1列),可以简化为Vol = V1xV2.V3,其中"x"是叉积和.".是点积.因此,为每个三角形计算该表达式,将这些体积相加并除以6.

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.

这篇关于计算多面体体积的通用公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆