This package contains Python bindings to use the following CGAL method: CGAL/extract_mean_curvature_flow_skeleton.
Andrea Tagliasacchi, Ibraheem Alhashim, Matt Olson, and Hao Zhang. Mean Curvature Skeletons.
Computer Graphics Forum (Proceedings of the Symposium on Geometry Processing), 31(5):1735–1744, 2012.
10.1111/j.1467-8659.2012.03178.x.
Free PDF.
CGAL Reference manual for Surface mesh skeletonization.
The recommended way to install this library is by using the conda package.
In your activated environment of choice, install the conda package by running:
conda install romicgal -c romi-euTo build and install from source, the following dependencies are required:
- C++ build tools (e.g.,
cmakeandmake) - A C++ Compiler compliant with C++ standard 11 or later (e.g.,
gccorclang) - The CGAL library (
CGAL) - The Eigen library (
Eigen3) - The GMP library (
GMP) - The MPFR library (
MPFR)
Example: On Ubuntu 22.04 & 24.04, you can install these dependencies with:
sudo apt install \
build-essential \
gcc \
libcgal-dev \
libeigen3-dev \
libgmp-dev \
libmpfr-devFirst, clone the source code and navigate to the project directory:
git clone https://github.com/romi/romicgal.git
cd romicgalWe recommend creating a dedicated conda environment to install the package and its dependencies. Use the provided YAML file to create an environment named romicgal as shown below:
conda env create --file conda/env/romicgal.yamlActivate your newly created environment and install the sources using pip:
conda activate romicgal
python -m pip install .A quick usage example:
import romicgal
from open3d import open3d
mesh = open3d.io.read_triangle_mesh('sample/TriangleMesh.ply')
points, lines, skelcorres = romicgal.skeletonize_mesh_with_corres(mesh.vertices, mesh.triangles)
l = open3d.geometry.LineSet()
l.points = open3d.utility.Vector3dVector(points)
l.lines = open3d.utility.Vector2iVector(lines)
open3d.visualization.draw_geometries([l])To package the library, follow the official Anaconda documentation on Conda Packages.
First, install anaconda-client and conda-build in the base environment:
conda install anaconda-client conda-buildThese steps must be performed in the base conda environment.
From the root romicgal/ directory and within the base environment, build the conda packages using the following command:
conda build conda/recipe/ -c conda-forge -c open3d-adminThe built packages will be stored in the folder ~/miniconda3/conda-bld/linux-64/.
This process must be completed in the base conda environment.
After successfully building the package, you can upload it with the command:
anaconda upload --user romi-eu --label main ~/miniconda3/conda-bld/linux-64/romicgal*.tar.bz2This process must be completed in the base conda environment.
