Skip to content

MattTheCuber/edge-mender

Repository files navigation

EdgeMender: A Topology Repair Algorithm for Voxel Boundary Meshes

pre-commit uv Ruff Actions status PyPI

Coverage

Coverage Report
FileStmtsMissBranchBrPartCoverMissing
edge_mender
   init.py2000100% 
   data_factory.py135000100% 
   edge_mender.py1600380100% 
   geometry_helper.py43080100% 
   mesh_generator.py740120100% 
   visualizer.py460220100% 
TOTAL4600800100% 

This tool repairs non-manifold edges in voxel boundary meshes to fix downstream operations such as smoothing. Non-manifold edges are defined as edges shared by four faces. Voxel boundary meshes are 3D surface representations of a data set where the faces and vertices perfectly snap to cells in a structured voxel grid. Common uses for this algorithm are repairing output from Cuberille, Surface Nets before smoothing, and non-adaptive Dual Contouring implementation without vertex adjustment. The algorithm procedure works for quad meshes, but this implementation is currently limited to triangular meshes (see #3). This algorithm requires input meshes to have proper and consistent winding order. The algorithm procedure works for quad meshes, but this implementation is currently limited to triangular meshes (see #3). This algorithm requires input meshes to have proper and consistent winding order.

The three algorithms listed above are provided in the mesh_generator module. A set of test data sets are provided in the data_factory module. A visualization tool is also provided in the visualizer module. The results folder contains the evaluation notebook while the example notebook quickly demonstrates the tool in use.

Getting Started

Install the package running:

pip install edge-mender

Then you can use the library like this:

from edge_mender import EdgeMender

mesh: trimesh.Trimesh = ...

mender = EdgeMender(mesh)
mender.repair()

For a walkthrough example, see the example notebook.

Contributing

Please see CONTRIBUTING.md

License

This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.

See LICENSE for more information.

About

A Topology Repair Algorithm for Voxel Boundary Meshes

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors