<p>I'm looking for a good 3D Mesh library</p>

<ul>
<li>Should be able to read popular formats (OFF, OBJ...)</li>
<li>Should support both half-edge structure and a triangle soup</li>
<li>Should be tolerant to faults and illegal meshes.</li>
<li>Basic geometric operations - intersections, normal calculation, etc'</li>
<li>Most importantly - Should not be convoluted with endless template and inheritance hierarchies.</li>
</ul>

<p>I've tried both CGAL and OpenMesh but both fail miserably in the last point.</p>

<p>Specifically CGAL which is impossible to follow even with the most advanced code analysis tools.</p>

<p>So far I'm seriously considering to pull my own.</p>

<p>My preference is C++ but I'm open to other options.</p>

[{'answer_id': 78746, 'author': 'HappyDude', 'author_id': 14266, 'author_profile': 'https://Stackoverflow.com/users/14266', 'pm_score': 4, 'selected': False, 'text': '<p>May I ask why the last point is a requirement?</p>\n\n<p>Libraries written for public consumption are designed to be as generic as possible so that it is usable by the widest possible audience.  In C++, this is often best done using templates.  It would suck tremendously if found a good library, only to discover it was useless for your purposes because it used floats instead of doubles.</p>\n\n<p>CGAL, for example, appears to have adopted the well-known and well-tested STL paradigm of writing generic and extensible C++ libraries.  This does indeed make it difficult to follow with code analysis tools; I doubt they\'re much good at following STL headers either.</p>\n\n<p>But are you trying to use the library or modify it?  Either way, they seem to have some extremely high-quality documentation (e.g. <a href="http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23/Chapter_main.html" rel="noreferrer">Kernel Manual</a>) that should make it relatively simple to figure out what you need to do, without having to resort to reading their code.</p>\n\n<p>Disclaimer:  I know this isn\'t what you\'re asking for.  But I don\'t think what you\'re looking for exists.  It is <strong>extraordinarily</strong> rare to find open source code with documentation as good as what I\'ve seen scanning through CGAL.  I would strongly suggest that you take another look at it.</p>\n'}, {'answer_id': 88895, 'author': 'Camille', 'author_id': 16990, 'author_profile': 'https://Stackoverflow.com/users/16990', 'pm_score': 2, 'selected': False, 'text': '<p>First, some general comments about you requirements:</p>\n\n<ul>\n<li>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.</li>\n<li>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)</li>\n<li>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.</li>\n</ul>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>If you do not know about robustness issues in geometry software, have a look at this page:\n<a href="http://www.mpi-inf.mpg.de/departments/d1/ClassroomExamples/" rel="nofollow noreferrer">robustness issues</a></p>\n'}, {'answer_id': 11021095, 'author': 'David', 'author_id': 1454439, 'author_profile': 'https://Stackoverflow.com/users/1454439', 'pm_score': 0, 'selected': False, 'text': '<p>I don\'t know if it can be useful for you. There is also another library, which is called the Mangrove TDS Library, freely available at <a href="http://mangrovetds.sourceforge.net" rel="nofollow">http://mangrovetds.sourceforge.net</a> It supports any type of shapes (2d, 3d, any dimension), with any domains (manifold, non-manifold, pseudo-manifolds, iqm complexes, simplicial complexes, and so on). It possibly supports non-regular shapes, i.e., formed by pieces of different dimensionalities.</p>\n\n<p>Its main property is that it is extensible, in the sense that any topological data structure is supported. It is a plugin, which can be changed and loaded at run-time.</p>\n\n<p>Its implementation is based on the array-based indexing of entities, encoded in a data structure, supporting iterators. It also supports dynamic properties.</p>\n\n<p>Finally, it supports an implicit representation of entities not directly encoded in a data structure (ghost entities), which improve efficiency of topological queries</p>\n'}]
['https://Stackoverflow.com/questions/78641', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9611/']