21

我正在寻找一个好的 3D Mesh 库

  • 应该能够阅读流行的格式(OFF,OBJ ...)
  • 应该同时支持半边结构和三角汤
  • 应该容忍故障和非法网格。
  • 基本几何运算 - 交点、法线计算等
  • 最重要的是 - 不应该与无尽的模板和继承层次结构复杂化。

我已经尝试过 CGAL 和 OpenMesh,但在最后一点都失败了。

特别是 CGAL,即使使用最先进的代码分析工具也无法遵循。

到目前为止,我正在认真考虑自己动手。

我的偏好是 C++,但我对其他选项持开放态度。

4

3 回答 3

13

请问为什么最后一点是要求?

为公共消费而编写的图书馆被设计为尽可能通用,以便尽可能广泛的受众使用。在 C++ 中,这通常最好使用模板来完成。如果找到一个好的库,它会非常糟糕,只是发现它对您的目的毫无用处,因为它使用浮点数而不是双精度数。

例如,CGAL 似乎采用了众所周知且经过充分测试的 STL 范式来编写通用和可扩展的 C++ 库。这确实使代码分析工具难以遵循;我怀疑他们也很擅长遵循 STL 标头。

但是您是在尝试使用该库还是对其进行修改?无论哪种方式,他们似乎都有一些非常高质量的文档(例如Kernel Manual),可以让您相对简单地弄清楚您需要做什么,而无需阅读他们的代码。

免责声明:我知道这不是您要的。但我认为你要找的东西不存在。很难找到具有与我通过 CGAL 扫描的一样好的文档的开源代码我强烈建议你再看看它。

于 2008-09-17T00:51:08.563 回答
2

First, some general comments about you requirements:

  • reading OBJ or OFF files is very easy. You could implement it yourself, on top of a library providing the more geometric features, in a few minutes. On the other hand, the geometric part of such libraries is so much more tricky that you should certainly focus on your requirements which really deal with the geometric algorithms, and try to find something which suits your needs. Then, of course, if there is a tie, start considering this interface issue.
  • in terms of geometric operations, you ask for intersection. Do you mean primitives intersection ? (for which good and simple algorithms can be found and implemented) or computation of the intersection of two meshes ? or collision detection ? (which are delicate questions, with no simple answer)
  • if you are more specific, from a higher level point of view, about the kind of tools you want to build, then people will be able to direct you to the right tool. Your requirements are too low-level.

As far as I understand your question, it seems to me that you do not clearly see the point of libraries like CGAL and OpenMesh. Such libraries may not provide all the higher level tools you need, but their aim is to provide you (especially in the CGAL case) all the geometric framework upon which you can build a geometric application. Such geometric frameworks are very delicate to design, especially because of the robustness issue, which is very specific to computational geometry. And without such a framework, building a robust application is an horrendous effort.

If you do not find a library which suits your need, you should seriously consider using a library such as CGAL as the underlying framework for your development. It will prevent the appearance of the robustness related problems, that you will typically only start noticing late in your development process, when changing the underlying framework will be painful. As an aside, CGAL has an extensive documentation, and a very active users' mailing-list.

If you do not know about robustness issues in geometry software, have a look at this page: robustness issues

于 2008-09-18T00:24:19.807 回答
0

我不知道它是否对你有用。还有另一个库,称为 Mangrove TDS 库,可在http://mangrovetds.sourceforge.net免费获得它支持任何类型的形状(2d、3d、任何维度),具有任何域(流形、非流形、伪流形、iqm 复形、单纯复形等)。它可能支持不规则的形状,即由不同维度的块组成。

它的主要特性是它是可扩展的,即支持任何拓扑数据结构。它是一个插件,可以在运行时更改和加载。

它的实现基于基于数组的实体索引,编码在数据结构中,支持迭代器。它还支持动态属性。

最后,它支持未直接编码在数据结构中的实体(幽灵实体)的隐式表示,从而提高了拓扑查询的效率

于 2012-06-13T18:28:30.740 回答