我试图使增量凸包算法的玩具实现更加健壮,并且在某些退化的情况下,有许多几乎共面的点,可见区域包含“洞”。
有没有办法检查标记为可见的面是否形成一个简单的连接区域?
我正在考虑某种 BFS,给定一个特定的起点,但我无法完全掌握它。
我试图使增量凸包算法的玩具实现更加健壮,并且在某些退化的情况下,有许多几乎共面的点,可见区域包含“洞”。
有没有办法检查标记为可见的面是否形成一个简单的连接区域?
我正在考虑某种 BFS,给定一个特定的起点,但我无法完全掌握它。
I'm assuming that you have easy ways to traverse your mesh. If not, then another algorithm might be more suitable.
Keep a set of edge indices that are border edges.
As you continue looping through all faces' edges looking for border edges, check each border edge against the set of border edges you got from your first loop. If the new border edge is not in the set of border edges then it forms a second loop, meaning that your selection isn't compact.