三角网格拓扑
我有一个三角形网格类,其中包含节点列表(在我的例子中是 2d,但这不重要)和面列表。 每个面都是一个三角形,它只包含节点数组的索引。 网格来自 Delaunay 算法,因此非常干净。
对于网格中的每个节点,我需要找到哪些节点通过单边连接到它。 构建和搜索该拓扑数据库的快速方法是什么?
多谢, 大卫·鲁顿
I've got a triangular mesh class which contains a list of nodes (2d in my case but that shouldn't matter) and a list of faces. Each face is a triangle and it only contains the indices into the node array. The mesh comes out of a Delaunay algorithm so it's very clean.
For every node in the mesh I need to find which nodes are connected to it with a single edge. What would be a fast way to construct and search this topology database?
Much obliged,
David Rutten
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有两种有点标准的数据结构可以促进网格拓扑查询。 一种是Winged Edges(通常也称为half-edge),另一个是 有向边。 谷歌一下,你会得到大量的细节,以及每个细节的不同级别的介绍。
对您的场景了解不够,无法推荐其中之一。 例如,有向边经过存储优化,最适合非常大的网格。 翼边被认为是“经典”,是更高级口味的良好起点。
实际上,如果您确定这是您需要的唯一查询,那么两者都太过分了,您只需使用单个哈希就可以了。 但是,如果您发现自己需要有效回答诸如“
脸?
您应该考虑深入研究其中之一。
There are two somewhat-standard data structs that facilitate mesh topology-queries. One is Winged Edges (commonly referred to also as half-edge), and the other is Directed Edges. Google around and you'd get kajillions of details, and various-level intros into each one.
Don't know enough about your scenario to recommend one of them. E.g., directed edges is storage-optimized, and best suited for very large meshes. Winged edges is considered a 'classic', and is a good starting point for more advanced flavours.
Actually if you're certain that's the only query you'd need, then both are an overkill and you'd do just fine with a single hash. If, however, you find yourself in need of efficient answers to queries like -
face?
You should consider diving into one of them.
我想我已经对哈希表、字典和排序列表视而不见了......以下可能是最简单和最快的:
I think I've stared myself blind on HashTables, Dictionaries and Sorted Lists... The following is probably the easiest and fastest: