Toolkit for Meshing in the Wild
git clone https://github.com/wildmeshing/wildmeshing-toolkit.gitcd wildmeshing-toolkit
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
makeYou may need to install gmp before compiling the code. You can install gmp via homebrew.
When executing CMake, the data repository will be automatically cloned into the data folder. You can find example meshes and json files for testing there. After compiling the code, you can run the applications under the app folder, e.g. for isotropic remeshing:
./build/app/wmtk_app -j data/integration_tests/isotropic_remeshing_bunny.jsonThis toolkit is a novel approach to describe mesh generation, mesh adaptation, and geometric modeling algorithms relying on changing mesh connectivity using a high-level abstraction. The main motivation is to enable easy customization and development of these algorithms via a declarative specification consisting of a set of per-element invariants, operation scheduling,and attribute transfer for each editing operation.
Many widely used algorithms editing surfaces and volumes can be compactly expressed with our abstraction, and their implementation within our framework is simple, automatically parallelizable on shared-memory architectures, and with guaranteed satisfaction of the prescribed invariants. These algorithms are readable and easy to customize for specific use cases.
This software library implements the abstractiona in our paper and providing automatic shared memory parallelization.
We will use the implementation of the shortest edge collapse algorithm as an example to introduce the framework and run through the basic software structures and APIs of the toolkit.
The algorithm is after [Hoppe 1996] Progressive Meshes which performs a series of collapse operations prioritizing the shorter edges. The algorithm requires only one local operation, edge collapse. We terminate when the mesh reaches a desired number of mesh elements.
We implemented class ShortestEdgeCollapse as a child class of wmtk::TriMesh. The 3d vertex positions are stored as a field of the VertexAttributes.
struct VertexAttributes
{
Eigen::Vector3d pos;
size_t partition_id = 0;
bool freeze = false;
};It is common to have a set of desiderata on the mesh that needs to be satisfied, such as avoiding triangle insertions or self-intersections. The responsibility of ensuring the user-defined explicit invariants being checked after every mesh modification, and after the input is loaded is assumed by the toolkit. It is much easier to ensure correctness for the user, as the checks are handled transparently by the toolkit.
As an example of user-defined invariants, in our shortest edge collapse implementation, we created an envelope around the original surface and designated that any operation shall not cause any vertex to move outside of the envelop, so that during local operations we can roughly keep the shape of the input mesh.
…To showcase the generality and effectiveness of our approach, we implemented five popular mesh editing algorithms in our framework. All algorithms are accessed through the same application wmtk_app and the user can specify which algorithm to run through the input JSON file. The five algorithms are listed below.
The JSON files are processed with the JSON Spec Engine.
Shortest Edge Collpase :
Qslim :
Isotropic Remeshing :
TetWild :
TriWild :
Examples for all algorithms can be found in the data repository.
MIT License.
No open issues yet, or sync has not completed.