3D 封闭网格汽车对象的体积

发布于 2024-08-04 16:05:25 字数 84 浏览 6 评论 0原文

我有一个 3D 封闭网格汽车对象,其表面已组成 三角形。我想计算它的体积、体积中心和惯性张量。

你能帮我吗

?问候。 乔治

I have a 3D closed mesh car object having a surface made up
triangles. I want to calculate its volume, center of volume and inertia tensor.

Could you help me

Regards.
George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

悲喜皆因你 2024-08-11 16:05:25

对于体积...

对于每个三角形面,查找其角点。称呼他们为 P、Q、R。
计算这个数量(我称之为“部分体积”),

pv =  PxQyRz + PyQzRx + PzQxRy - PxQzRy - PyQxRz - PzQyRx

将所有面的这些数量加在一起,然后除以 6。

重要!从外部看,每个面的 P、Q、R 必须按顺时针方向排列。 (或者全部逆时针,只要所有面都一致。)

如果网格有任何四边形,只需暂时想象一条连接一对对角的对角线。这样它就变成了两个三角形。

实际计算改进:在使用 P、Q 和 R 进行数学运算之前,减去某个“中心”点 C 的坐标。这可以是质心、最小/最大 x、y 和 z 之间的中点,或任何方便的点位于网格内部或附近。这有助于最大限度地减少截断错误,以获得更准确的体积。

For volume...

For each triangular facet, lookup its corner points. Call 'em P,Q,R.
Compute this quantity (I call it "partial volume")

pv =  PxQyRz + PyQzRx + PzQxRy - PxQzRy - PyQxRz - PzQyRx

Add these together for all facets and divide by 6.

Important! The P,Q,R for each facet must be arranged clockwise as seen from outside. (Or all counter-clockwise, as long as it's consistent for all facets.)

If the mesh has any quadrilaterals, just temporarily hallucinate a diagonal joining one pair of opposite corners. That makes it into two triangles.

Practical computationial improvement: Before doing math with P,Q and R, subtract the coordinates of some "center" point C. This can be the center of mass, a midpoint between the min/max x, y and z, or any convenient point inside or near the mesh. This helps minimize truncation errors for more accurate volumes.

旧城烟雨 2024-08-11 16:05:25

从数值的角度来看,您想要实现的目标非常简单,可以简化为计算几个求积。维基百科将提供有关其背后的数学所需的信息。

如果您正在寻找开箱即用的体积计算,请查看 此条目
至于惯性——形状是不够的,因为你还需要质量的分布。

From numerical point of view, what you are trying to achieve is quite simple and can be reduced to calculating few quadratures. Wikipedia will provide needed information about maths behind it.

If you are looking for out-of-the-box volume calculation, take a look at this entry.
As of inertia -- shape is not enough, as you also need distribution of mass.

一张白纸 2024-08-11 16:05:25

好吧,这里提供的关于汽车的信息并不多 - 您应该能够将汽车分解为更简单的形状 - 您需要的近似程度越高 - 您可以将其分解为更简单的形状。 (如果汽车以某种方式动态生成并且每次都完全不同,这可能会很困难......但我认为这种情况没有任何意义)。

这应该有助于找到各种更简单形状的惯性张量: http:// /www.gamedev.net/community/forums/topic.asp?topic_id=57001 ,查找球体和立方体等物体的体积等是相当常见的知识,所以我不会费心链接它。

Well, there isn't much information on the car being provided here - you should be able to break down the car into simpler shapes - the higher degree of approximation your require - the more simpler shapes you can break it into. (This could be difficult if the car is somehow dynamically generated and completely different every time ... but I don't see that situation making any sense).

This should help with finding the Inertial Tensor of various simpler shapes: http://www.gamedev.net/community/forums/topic.asp?topic_id=57001 , finding the volumes and the likes of things like spheres and cubes is pretty common knowledge so I won't bother linking that.

仲春光 2024-08-11 16:05:25

我认为是阿基米德发现,如果将汽车浸入一定体积的液体中,排出的液体将与汽车的体积相同。

但我不确定这对你在这种情况下有什么帮助。在后台运行液体模拟并将网格体浸入其中听起来有点夸张。虽然,我认为它确实有效,因此有资格作为一个(尽管有点无用)答案。 ;^)

I think it was Archimedes who discovered that if you submerge the car in a volume of liquid, the displaced liquid will have the same volume as the car.

I'm not sure what this would help you in this case though. Having a liquid simulation running in the background and submerging the mesh into it sounds a bit over the top. Although, I think it does work, and therefore qualifies as a (bit useless nonetheless) answer. ;^)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文