This is an implementation of the volumetric mapping method presented in the SIGGRAPH Asia 2024 paper "Bijective Volumetric Mapping via Star Decomposition". Previous restrictions to star-shaped or convex shapes are lifted. The central idea is a systematic decomposition into simpler subproblems.
The implementation covers the steps:
- Target decomposition into star-shaped parts
- Compatible source decomposition
- Boundary map extension onto interior part boundaries
It outputs the subproblems which can subsequently be handled by bijective mapping methods that require star-shaped targets, e.g. GalaxyMaps.
If you find this code useful, please consider citing our paper:
@article{StarDecompositionMaps,
author = {Hinderink, Steffen and Br{\"u}ckler, Hendrik and Campen, Marcel},
title = {Bijective Volumetric Mapping via Star Decomposition},
year = {2024},
journal = {ACM Trans. Graph.},
volume = {43},
number = {6},
pages = {168:1--168:11}
}The code can be used as either a library or an executable.
In either case, the following libraries need to be installed:
The following libraries are included in the ext directory:
For the viewer:
Remember to clone this repository recursively:
git clone --recursive https://github.com/SteffenHinderink/StarDecompositionMaps.git
The library can be included via CMake like this:
add_subdirectory(path/to/StarDecompositionMaps)
target_link_libraries(yourTarget StarDecompositionMaps)The function sdm implements the method of the paper.
Input are the tetrahedral meshes retetrahedrize using
TetGen
can be used to achieve this.
To represent the boundary map Q of type Vector3q.
The meshes
The algorithms for the different steps of the methods can also be used independently.
- The function
decomposeimplements the decomposition of a mesh into star-shaped parts. - The function
cutfinds a surface in a mesh given a boundary loop. It includes the surface shift algorithm. - The function
alignimplements the recursive triangulation alignment algorithm.
#include <retet.h>
#include <sdm.h>
Mesh M = ...;
Mesh N = ...;
retetrahedrize(N); // optional, in case N has degenerate or inverted tetrahedra
std::vector<std::pair<Mesh, Mesh>> components = sdm(M, N);
for (int i = 0; i < components.size(); i++) {
Mesh& Mi = components[i].first;
Mesh& Ni = components[i].second; // star-shaped
auto Q = Ni.property<Vertex, Vector3q>("Q");
for (auto v : Ni.vertices()) {
std::cout << "(" << Q[v].transpose() << ")" << std::endl;
}
}mkdir buildcd buildcmake [-DGUI=OFF] ..(The optionGUIcontrols if the program is built with the viewer)make -j
./sdm <M> <N> [-o <out_dir>]
-
<M>: Tetrahedral mesh$M$ . -
<N>: Tetrahedral mesh$N$ . This may contain degenerate or inverted tetrahedra. In that case, TetGen is used to create a new tetrahedrization. Corresponding boundary vertices of$M$ and$N$ must have the same indices. -
-o <out_dir>: Optional argument to output the mesh pairs into the directoryout_dir. Meshes are output in.ovmformat and have the propertyQ_stringof typestd::stringcontaining the rational vertices as strings.
e.g. ./sdm ../meshes/open.vtk ../meshes/thumb.vtk
The viewer shows the components in different colors.
Pressing P switches between
