{width=20% style="display: block; margin: 0 auto"}
This is the implementation of HexHex. Motivated by recent improvements in the generation of valid integer-grid maps (IGMs), HexHex extracts a hex mesh from a tet mesh and a locally injective(!) IGM in a fraction of the time that was required previously. Additionally, there is the option to extract piecewise-linear edge arcs and -face patches. It is strongly based on HexEx [Lyon et al. 2016], which, unlike HexHex, accepts local defects in the IGM.
If you make use of HexHex in your work, we kindly ask you to cite our paper. (You can use the bibtex snippet below.)
@article{10.1145/3730940,
author = {Kohler, Tobias and Heistermann, Martin and Bommes, David},
title = {HexHex: Highspeed Extraction of Hexahedral Meshes},
year = {2025},
issue_date = {August 2025},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {44},
number = {4},
issn = {0730-0301},
url = {https://doi.org/10.1145/3730940},
doi = {10.1145/3730940},
journal = {ACM Trans. Graph.},
month = jul,
articleno = {147},
numpages = {20},
keywords = {hexahedral meshing, integer-grid map, optimization} }
Further links:
- Bachelor Thesis (The humble beginnings)
- OpenFlipper Plugin
brew install cmake pkgconf jemalloc # (`jemalloc` is optional)
cmake -B build .
cmake --build buildThis should result in a binary ./build/Build/bin/HexHex.
To extract a Hex Mesh, simply call
HexHex::TetrahedralMesh tetmesh = ...
HexHex::HalfFaceProp<HexHex::Vec3d> igm = ...
auto result = HexHex::extractHexMesh(tetmesh, igm);using a OpenVolumeMesh as input. In the igm property, each (non-boundary) halfface is expected to store the vertex parameter of its opposing vertex in its incident cell.
The function
std::optional<ParametrizedMesh> mesh = HexHex::loadInputFromFile(filename);can be used to load a tet mesh and IGM from a .hexex file, .ovm file, or .ovmb file.
If the mesh is loaded from a .ovm or .ovmb file, the mesh is expected to store the integer-grid map as a HalfFaceProperty<Vec3d> named HexHex::Parametrization.
The output hex mesh can be stored to the .ovm, .ovmb or to .mesh format.
bool successful_saving = HexHex::saveOutputToFile(filename, *result.hex_mesh);You can also use the internal HexExtractor class directly. For this, you have two options.
-
OVM Tetrahedral Mesh and Template Integer Grid Map The igm must implement the subscript operators igm[CellHandle][VertexHandle]
HexHex::TetrahedralMesh tetmesh = ... IntegerGridMapT igm = ... HexHex::HexExtractor he(tetmesh, igm); auto result = he.extract();
-
OVM Tetrahedral Mesh with HalfFaceProperty
HexHex::TetrahedralMesh tetmesh = ... HexHex::HalfFaceProp<HexHex::Vec3d> igm = ... HexHex::HexExtractor he(tetmesh, igm); auto result = he.extract();
The extract methods can take in an optional config object containing some runtime parameters.
auto config = HexHex::Config();
config.extract_piecewise_linear_edges = true; // (default false)
config.extract_piecewise_linear_edges = true; // (default false)
config.num_threads = 8; // (default 1)
...
HexHex::extractHexMesh(tetmesh, igm, config);The supported file formats for input and output are as clarified above.
Minimal use case:
HexHex --in TetMesh.ovmb --out-hex HexMesh.ovmb- Load Parametrized Tet Mesh
- Extract Hex Mesh