PyGEL 3D

raw JSON →
0.6.1 verified Fri May 01 auth: no python

PyGEL 3D provides Python bindings for the GEL (Geometry Engine Library), offering tools for polygonal mesh based geometry processing, including mesh I/O, simplification, remeshing, and boolean operations. Current version is 0.6.1. Release cadence is irregular.

pip install pygel3d
error ModuleNotFoundError: No module named 'pygel'
cause The package name changed from 'pygel' to 'pygel3d'.
fix
Install pygel3d: pip install pygel3d, and import as from pygel3d import ...
error AttributeError: module 'pygel3d' has no attribute 'Mesh'
cause Forgot to import Mesh explicitly. Although pygel3d exposes Mesh, some submodules must be imported directly.
fix
Use 'from pygel3d import Mesh' instead of 'import pygel3d' and then pygel3d.Mesh.
error AttributeError: 'Mesh' object has no attribute 'num_faces'
cause num_faces() is a method of hmesh.HalfedgeMesh, not of Mesh.
fix
Convert Mesh to half-edge mesh: hm = hmesh.Manifold.from_mesh(mesh); print(hm.num_faces()).
breaking The import path changed from 'pygel' to 'pygel3d' starting with version 0.6.0. Old code using 'import pygel' will fail.
fix Replace 'import pygel' with 'import pygel3d' and update all submodule references accordingly.
gotcha Mesh simplification functions expect a hmesh.HalfedgeMesh object, not a raw Mesh. Passing a Mesh will cause AttributeError.
fix Convert Mesh to half-edge mesh using hmesh.Manifold.from_mesh() before calling simplify functions.
deprecated The 'gl_display' module relies on PyOpenGL and may be removed in future releases as the library moves to headless processing.
fix Use external visualization libraries (e.g., trimesh, polyscope) instead of gl_display.

Creates a simple box mesh, converts to half-edge representation, and prints face count.

from pygel3d import Mesh, hmesh

# Create a simple mesh (a box)
box_mesh = Mesh()
box_mesh.add_vertex([0,0,0])
box_mesh.add_vertex([1,0,0])
box_mesh.add_vertex([1,1,0])
box_mesh.add_vertex([0,1,0])
box_mesh.add_face([0,1,2,3])

# Convert to half-edge mesh
hm = hmesh.Manifold.from_mesh(box_mesh)
print("Number of faces:", hm.num_faces())