CGAL 网格交叉/碰撞 [英] CGAL Mesh(es) intersection/collision

查看:31
本文介绍了CGAL 网格交叉/碰撞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的跟踪管道中有一个碰撞检测模块,检测两个不同的网格何时发生碰撞/相互渗透,或者是否存在铰接网格的自渗透.基于渗透的深度,应该有一个惩罚来对抗这种现象.我应该得到碰撞面/顶点的列表才能这样做.

I would like to have a collision detection module in my tracking pipeline, detecting when two different meshes collide/interpenetrate or if there is a self-penetration of an articulated mesh. Based on the depth of the penetration there should be a penalization that combats this phenomenon. I should get a list of the colliding faces/vertices in order to do so.

在检查了几个选项后,我决定开始使用 CGAL.

After examining several options, I decided to start working with CGAL.

此链接中,有一个有趣的答案指向了一些示例.(thisthis).这些示例使用 AABB(轴对齐边界框),这是非刚性网格的建议方法,因为需要对其进行频繁更新.自相交情况的例子很清楚,但以下对我来说不是很清楚:

In this link there is an interesting answer pointing to some examples. (this and this). The examples use AABBs (Axis-Aligned Bounding Boxes), which is the proposed way for non-rigid meshes, since a frequent update of them is needed. The examples are clear for the self-intersection case, but the following are not very clear to me:

  • 除了为每个三角形创建一个 B.Box 之外,我猜没有在引擎盖下创建树结构来加速搜索过程.是这样吗?如果是,是否有任何提示?
  • 如果有 2 个单独的网格,我想将所有三角形/框合并到一个向量中并按照示例进行操作是不好的(尽管提到了 这里 作为解决方案,听起来并不那么优雅).有什么好的练习提示吗?是否应该通过创建三角形/盒子树来混合这些示例?虽然提到了 AABB 树:
  • Apart from creating a B.Box for each triangles, I guess that there is no tree structure created under the hood to speed up the search process. Is it so? If yes, any hint to do so?
  • In case of 2 separate meshes, I guess it's not nice to merge all triangles/boxes in one vector and follow the examples (though it is mentioned here as a solution, it doesn't sound so elegant). Any hint for a nice practice? Should one mix these examples, by creating trees of triangles/boxes? Although for the AABB tree it is mentioned that:

请注意,此组件适用于查找所有相交对象对的问题.我们参考组件 dD Iso-orienting Boxes 的相交序列 可以找到所有相交的iso-orientation box对.

Note that this component is not suited to the problem of finding all intersecting pairs of objects. We refer to the component Intersecting Sequences of dD Iso-oriented Boxes which can find all intersecting pairs of iso-oriented boxes.

推荐答案

  1. 函数 CGAL::box_intersection_d 动态创建线段树,加速相交 AA 边界框对的计算.
  2. 据我所知,推荐的方法是将两个表面合并为一个 自定义框,其中框有一个字段来指示三角形所属的表面的标识符.这有助于从同一表面快速丢弃成对的盒子.
  1. The function CGAL::box_intersection_d creates segment trees on the fly, to speed the computation of pairs of intersecting AA-bounding boxes.
  2. As far as I know, the recommended way is to merge the two surfaces in one vector of custom boxes, where the boxes have a field to indicate the identifier of the surface the triangle belongs to. That helps to quickly discard pairs of boxes from same surface.

这篇关于CGAL 网格交叉/碰撞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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