PyGEL3D Documentation¶
Welcome to the PyGEL3D documentation. PyGEL3D is a Python library for geometry processing, providing tools for working with 3D polygonal meshes, graphs, and spatial data structures.
What is PyGEL3D?¶
PyGEL3D is a collection of classes and functions for geometry processing tasks, especially those involving 3D polygonal meshes. It is based on the C++ GEL library and provides a Python interface for most of its functionality.
Key Features¶
GEL contains several data structures for spatial data, and our mature halfedge data structure for polygonal meshes and a graph data structure are also exposed in PyGEL.
Several algorithms developed as part of our research are exposed in GEL and PyGEL. For instance, the Rotations System Reconstruction (RSR) algorithm for reconstruction of triangle meshes from point clouds and the Local Separator Skeletonization method for extracting curve skeletons from anything represented as a spatially embedded graph are both implemented in this library.
A number of standard techniques have also been implemented. For instance, Garland-Heckbert simplification, several schemes for subdivision, curvature computation methods, signed distance field computation, and a number of methods for smoothing (including feature preserving smoothing) are also provided by the library.
Both in the C++ and Python library, tools are provided for analysis and editing of polygonal meshes through primitive (Euler) operations (splitting faces by inserting an edge or a vertex, collapsing edges or removing edges, etc.). Since the halfedge based representation is not restricted to triangles, these tools work for general polygonal meshes.
A number of tools for visualization are also provided. Perhaps most importantly, the Python package provides a simple viewer and a component for visualization in Jupyter notebooks that is based on Plotly.
Modules¶
PyGEL3D consists of five main modules:
- hmesh: Halfedge mesh data structure and operations
- graph: Graph data structure for spatial graphs
- spatial: Spatial data structures (kD-Trees, distance queries)
- gl_display: OpenGL-based visualization
- jupyter_display: Jupyter notebook integration
Quick Example¶
from pygel3d import hmesh, gl_display as gl
from sys import argv
m = hmesh.load(argv[1])
hmesh.close_holes(m)
hmesh.triangulate(m)
hmesh.quadric_simplify(m, 0.05)
v = gl.Viewer()
v.display(m) # Hit ESC to exit
Getting Started¶
Ready to dive in? Check out the Installation Guide, the Quick Start, and the Introduction to PyGEL tutorial.