An implementation of our new paper Volume Quantization with Flexible Singularities for Hexahedral Meshing (coming to Eurographics 2026) has been integrated recently. It allows adaptive simplification of the initial singularity graph at the quantization level via QGP3D and can extract the simplified structure or a hex mesh.
Additionally we have recently integrated direct volume mesh visualization via polyhydra into the library, enabling fast and interactive visualization of the algorithm's stages and their results.
C4HexMeshing is an implementation of Collapsing Embedded Cell Collapses for Safer Hexahedral Meshing [Brückler et al. 2023] (SIGGRAPH Asia 2023) distributed under GPLv3.
If you make use of C4HexMeshing in your scientific work, please cite our paper. For your convenience,
you can use the following bibtex snippet:
@article{C4HexMeshing,
author = {Hendrik Br{\"{u}}ckler and
Marcel Campen},
title = {Collapsing Embedded Cell Collapses for Safer Hexahedral Meshing},
journal = {ACM Trans. Graph.},
volume = {42},
number = {6},
year = {2023},
}C4HexMeshing makes use of the 3D Motorcycle Complex to partition a tetrahedral mesh, equipped with a suitable seamless map, into blocks. A quantization of the cubical cell complex is then computed using QGP3D, assigning non-negative integer lengths to the complex' edges.
To extract from this complex a valid integer-grid map and thus a hex mesh, all edges, patches and blocks of the complex which were quantized to zero extent are collapsed and their content redistributed among the remaining elements. On the remaining cell complex, whose cells are now blocks of strictly positive integer extents, an integer-grid map can be computed blockwise via (relatively simple) cube maps. From this a hex mesh can be extracted.
Note, that (currently) no geometric optimization other than tentative untangling of the integer-grid map is performed, but some might be added in the future.
- GMP (NOT included, must be installed on your system)
- Clp (NOT included, must be installed on your system)
- NLOPT (optional, for map optimization, NOT included, must be installed on your system)
- MC3D (included as submodule, together with all subdependencies)
- QGP3D (icluded as submodule, together with all subdependencies)
- polyhydra (volume mesh viewer, included as submodule, enabled via CMake flag
-DMC3D_WITH_VIEWER=On)
In root directory
mkdir build
cd build
cmake -DGUROBI_BASE=<path/to/gurobi/> ..
make
An example command-line application is included that reads a tetrahedral mesh including a seamless parametrization from a file in .hexex-format, as used and documented in libHexEx. It can generate the output of several stages of the algorithm, including the original MC, collapsed MC, integer-grid map (unoptimized) and hex mesh (unoptimized).
After building, the CLI app can be found in build/Build/bin/ .
For full information on its usage, execute
c4hex_cli --help
Example input can be found in folder extern/MC3D/tests/resources.
A dataset of 200 precomputed motorcycle complexes on seamless parametrizations from various sources is available under MC3D-samples.
Additionally, the CLI (and library) can be built with support for volume mesh visualization via polyhydra, by calling CMake with the additional flag -DMC3D_WITH_VIEWER=On.
In this case a dedicated viewer app for inspecting the extracted meshes is built as build/Build/bin/c4hex_viewer_demo.
For details on the API of the library, check the headers in include, they are thoroughly documented. Apart from that, cli/main.cpp demonstrates usage of the entire pipeline for both simple and advanced usage.


