Skip to content

Implementation of coarse hole filling algorithm for triangle meshes by P. Liepa.

License

Notifications You must be signed in to change notification settings

russelmann/hole-filling-liepa

Repository files navigation

Warning: This repo is work in progress.

Hole Filling Liepa

Build status Python 3.8+ MIT License Platforms

Implementation of a coarse hole filling algorithm for triangle meshes. Main purpose is a Python package. Can be used as a C++ library as well.

Based on paper Filling Holes in Meshes, P. Liepa, Eurographics Symposium on Geometry Processing (2003).

Bunny with hole Patched Bunny

Installation

Conda (recommended)

conda install -c conda-forge hole-filling-liepa

PyPI (not recommended)

Only Python 3.9, x64 Windows and MacOS 11 are supported at this point.

pip install hole-filling-liepa

From source using Conda

  1. Clone this repository.
  2. Create build environment running script create-env.sh in Linux/MacOS or create-env.bat in Windows.
  3. Activate build environment. conda activate ../hfl-env
  4. Build development version from source. pip install -e .

Usage example

from hole_filling_liepa.core import fill_hole_liepa, find_boundary_loops
from hole_filling_liepa.utils import read_obj, write_obj

vertices, faces = read_obj('mesh.obj')
boundary_loops = find_boundary_loops(faces)
patch_faces = fill_hole_liepa(vertices, faces, boundary_loops[0], method='angle')
write_obj('patch.obj', vertices, patch_faces)