Registry / data / libigl

libigl

JSON →
library2.6.2pypypi✓ verified 85d ago

libigl provides Python bindings for the C++ libigl library, a powerful and simple geometry processing toolkit. It offers a wide range of functionalities, including discrete differential geometry operators, finite-element matrices, and mesh topology data structures. The current version is 2.6.2, and the library is actively developed with frequent releases.

pip install libigl
INSTALL
IMPORT
SIG · LIBIGL
L
libigl
datapythonv2.6.2
Install
7.7s avg
Import
953ms
Disk
265MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.6.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.7s · import 0.953s · 262MB
265MB installed
● package 265MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

igl
import igl
All libigl functions are exposed directly under the 'igl' module.
read_triangle_mesh
import igl V, F = igl.read_triangle_mesh('path/to/mesh.obj')
Functions are direct attributes of the 'igl' module.

This quickstart demonstrates how to create a simple mesh, save it to a file using `igl.write_triangle_mesh`, and then load it back using `igl.read_triangle_mesh`. It uses NumPy arrays for vertex coordinates and face connectivity. For interactive visualization, additional libraries like `meshplot` (not included here) are often used.

import igl import numpy as np import os # Create a simple mesh (triangle on the XY plane) V = np.array([ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0] ], dtype=np.float64) F = np.array([ [0, 1, 2] ], dtype=np.int32) # Define a path for saving/loading output_dir = os.environ.get('LIBIGL_OUTPUT_DIR', '.') output_mesh_path = os.path.join(output_dir, 'example_triangle.obj') # Save the mesh success = igl.write_triangle_mesh(output_mesh_path, V, F) print(f"Mesh saved successfully: {success} to {output_mesh_path}") # Load the mesh back V_loaded, F_loaded = igl.read_triangle_mesh(output_mesh_path) print(f"Loaded Vertices shape: {V_loaded.shape}, Faces shape: {F_loaded.shape}") # Example: Calculate edge lengths (requires a function like igl.edge_lengths) # This is illustrative; actual function name might vary and require more imports. # If igl.edge_lengths existed, it might look like: # L = igl.edge_lengths(V, F) # print(f"Edge lengths: {L}") # Cleanup (optional) # os.remove(output_mesh_path)
Debug
Known issues
breakingMajor breaking changes were introduced in versions 2.5.4.dev0, carrying forward into 2.6.0 and later. These versions involved a complete rewrite of the Python bindings source code and the build system (transitioning to nanobind). Code written for pre-2.5.4.dev0 versions will likely require significant updates.
fix
Review the official GitHub repository and tutorials for updated API usage. Many functions or their signatures may have changed.
affects: >=2.5.4.dev0
deprecatedThe `igl.__version__` attribute was removed in version 2.5.4.dev0. Directly accessing this attribute will raise an `AttributeError`.
fix
To programmatically get the installed package version, use `importlib.metadata.version('libigl')`.
affects: >=2.5.4.dev0
gotchaThe official Python binding documentation is noted as 'perennially out of date' and may be removed or changed. Users should prioritize the GitHub repository's README, examples, and the C++ libigl documentation for the most accurate and up-to-date information.
fix
Refer to the `libigl-python-bindings` GitHub repository's `tutorial` and `tests` directories for current usage patterns and examples, and the core C++ `libigl` documentation for function details.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'igl'
The `libigl` Python package is not installed in the current Python environment or the environment is not correctly activated.
fix
Ensure `libigl` is installed by running `pip install libigl`. Verify the correct Python environment is active if using virtual environments.
NameError: name 'plot' is not defined (or similar plotting errors like 'display is undefined')
The `libigl` library itself does not include plotting functionality. Visualization in tutorials often relies on external libraries like `meshplot`.
fix
Install `meshplot` (or another visualization library like `matplotlib`, `vedo`, etc.) separately: `pip install meshplot`. Ensure it's imported correctly: `from meshplot import plot`.
Failed to clone repository: 'https://github.com/libigl/libigl.git/' (or similar CMake/Git errors during installation)
This error typically occurs when attempting to install `libigl` from source (e.g., `pip install .` in a cloned repo) and the build process fails to clone the underlying C++ `libigl` library or its dependencies, often due to network issues, firewall restrictions, or missing Git/CMake.
fix
For standard usage, install the pre-compiled wheels via `pip install libigl` rather than building from source. If building from source is necessary, ensure Git and CMake are installed and accessible, and check network connectivity to GitHub.
Upgrade
Version history
2.6.2latest on PyPI · released Mar 5, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
numpyrequiredFundamental for dense matrix and vector operations.
scipyrequiredUsed for sparse matrix operations.
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
libigl — pip install libigl · libregistry