문제

I'm looking for a C++ library to triangulate arbitrary 3D meshes. Preferably open-source but at the very least free for commercial use (so CGAL is pretty much out of the question).

I looked at GTS, but it's written in C (is C compatible with C++?), it's old, and the binaries are for Debian platforms (I need Windows binaries or source that can be compiled in VC++ 2008).

Any help would be much appreciated.

Additionally:

If it's possible to use a 2D polygon triangulation library such as polypartition or poly2tri by triangulating each face separately, I can guarantee every face stays on its own plane (every face is flat and all the vertices are on the same plane) and has no holes. I'm not sure how I would go about translating the 3D rotation of the face to 2D space; I assume you would need to use the face's normals. I'm also not sure whether the generated 2D vertices could easily be merged back into the 3D mesh if you were to triangulate each face separately.

도움이 되었습니까?

해결책

I worked it out myself. Turns out the library that generated the mesh that needed triangulating, Carve, isn't necessarily free for commercial use, so I had to find an alternative. I found Boost (I didn't realise it had these kinds of functions), which has the perfect license for me, is free, of high quality, and seems to have the functions I need. So...hooray!

다른 팁

Check out umeshu. It's under the MIT license.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top