[opensource-dev] Mesh decomposition using hacd

Nicky D. sl.nicky.ml at googlemail.com
Thu Sep 1 14:02:41 PDT 2011


Good morning everyone,

after getting GLOD in shape I continued playing with HACD and using it
for mesh uploading.

The current status looks promising so far. I had been able to upload a few
meshes using it.

For anyone interested the code for the lib can be found here:
https://bitbucket.org/NickyD/convexdecompositionhacd

I only used it under Linux so far. So when it comes to compiling Windows user
are a bit on their own right now.

For Linux you can use the following few steps after cloning and being
in the convexdecompositionhacd directory.

- mkdir build && cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/install
- make
- make install

Now you will end up with two libs in /tmp/install/lib (and
llconvexdecomposition.h
in /tmp/install/include).

Copy those libs where the linker can find them.

Now you want two other changesets applied to your viewer souces:

1) https://bitbucket.org/NickyD/viewer-development/changeset/cf82fc1a6683
This one will just pull the correct libs into your linker settings,

2) https://bitbucket.org/NickyD/viewer-development/changeset/1f9086200bbc

That's a tricky one, because I am yet not sure if it is the correct
way to solve things.
The idea behind it is the viewer detecting if it is linked against
HACD, if yes then
it will always passed Meshes with triangles into it.

HACD always wants to have triangles and vertices before it even considers
computing anything. This little workaround seems to work well, but I am not sure
if it is always safe to do it this way.

Cheers,
   Nicky


More information about the opensource-dev mailing list