Install V-HACD on Windows
masterTo build V-HACD on Windows, navigate to the app directory, run CMake specifying the x64 platform, and then load the resulting solution file in your IDE.
cd app
cmake -DCMAKE_GENERATOR_PLATFORM=x64 CMakeLists.txtrepository·master·Indexed 23 days ago
https://github.com/kmammou/v-hacdVoxelized Hierarchical Approximate Convex Decomposition (V-HACD) is a library for decomposing 3D surfaces into near-convex parts for collision detection and 3D modeling. Version 4.0+ is a header-only C++ library. The documentation covers installation on Linux and Windows, integration as a header-only library, and tuning parameters for decomposition such as error threshold, voxel resolution, and hull counts.
To build V-HACD on Windows, navigate to the app directory, run CMake specifying the x64 platform, and then load the resulting solution file in your IDE.
cd app
cmake -DCMAKE_GENERATOR_PLATFORM=x64 CMakeLists.txtTo build V-HACD on Linux, navigate to the app directory and use CMake to generate the build files and compile the project in Release mode.
cd app
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildV-HACD 4.0+ focuses on user-defined hull counts rather than finding a 'minimum solution'. You should specify the number of convex hulls that matches your design goals. The default is 32 hulls, which may be too high for simple shapes.
For high-precision results (e.g., for machined parts with sharp angles), you can use the following CLI flags:
-e <value>: Error threshold (e.g., -e 0.01 for high accuracy).-r <value>: Voxel resolution (e.g., -r 10000000 for high resolution).-h <value>: Number of convex hulls (e.g., -h 128).-d <value>: Maximum decomposition depth (e.g., -d 15). Note that higher depth values require a 64-bit build. A depth of 15 allows the algorithm to recurse much deeper but will significantly increase execution time.ENABLE_VHACD_IMPLEMENTATION as 1 in exactly one .cpp file before including VHACD.h. There are no separate library files or additional .cpp files to compile or link.If porting from older versions of V-HACD, note the following changes to tuning parameters and API signatures:
| Old Parameter | New Parameter / Status |
|---|---|
m_concavity | m_minimumVolumePercentErrorAllowed |
m_alpha | Removed |
m_beta | Removed |
m_projectHullVertices | m_shrinkWrap |
IUserCallback Update Signature Change:
The Update function signature in IUserCallback has changed to:
virtual void Update(const double overallProgress,
const double stageProgress,
const char* const stage,
const char *operation) final