Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Scientific Computing
  3. pygalmesh

pygalmesh

GPL-3.0C++v0.10.6

A Python interface to CGAL's 2D and 3D mesh generation tools for creating high-quality meshes from geometric domains.

GitHubGitHub
665 stars67 forks0 contributors

What is pygalmesh?

pygalmesh is a Python library that provides an interface to CGAL's meshing tools for generating high-quality 2D and 3D meshes. It solves the problem of creating structured and unstructured meshes from geometric domains, level-set functions, and various input formats, which is essential for simulations, visualization, and computational analysis.

Target Audience

Researchers, engineers, and developers in computational science, finite element analysis, computer graphics, and biomedical imaging who need robust mesh generation integrated into Python workflows.

Value Proposition

Developers choose pygalmesh because it combines the proven reliability of CGAL's meshing algorithms with a clean Python API, supporting a wide range of input types and offering advanced features like local refinement and periodic meshing not easily found in other Python mesh libraries.

Overview

:spider_web: A Python interface to CGAL's meshing tools

Use Cases

Best For

  • Generating volume meshes for finite element simulations from geometric primitives
  • Creating surface meshes from implicit functions or level-set representations
  • Converting 3D medical imaging data (e.g., voxel arrays) into computational meshes
  • Remeshing existing surface meshes to improve quality for simulation or rendering
  • Producing periodic meshes for materials science or photonic crystal simulations
  • Extruding 2D polygons into 3D meshes with optional rotation for CAD-like workflows

Not Ideal For

  • Applications requiring automatic sharp edge handling in domain unions or differences without manual specification
  • Real-time or interactive systems where sub-second mesh generation speed is critical
  • Environments with strict pure-Python dependency constraints that cannot install C++ libraries like CGAL
  • Simple meshing tasks where lighter libraries like trimesh suffice for basic surface operations

Pros & Cons

Pros

CGAL Algorithm Access

Provides direct integration with CGAL's proven meshing algorithms, ensuring high-quality volume and surface meshes as demonstrated in examples like ball generation and custom level-set functions.

Diverse Input Compatibility

Supports meshing from geometric primitives, level-set functions, INR voxel files, and 3D numpy arrays, enabling use cases from CAD to medical imaging, as shown with the breast phantom example.

Advanced Feature Set

Includes local refinement via functions, periodic meshing, and surface remeshing, offering fine control over mesh density and structure for scientific simulations.

Python API Convenience

Exposes CGAL's capabilities through a clean Python interface, making advanced meshing accessible without deep C++ knowledge, with extensive examples in the README.

Cons

Manual Intersection Handling

Sharp edges in combined domains require explicit definition via feature edges, which can be tedious and error-prone, as highlighted in the ball difference example where a circle must be manually added.

Complex Dependency Setup

Installation relies on system-wide CGAL and Eigen libraries, with potential issues like symbolic link fixes on MacOS, complicating deployment in some environments.

Limited Sharp Edge Automation

Unlike bounding-plane approaches (e.g., mshr), automatic handling of sharp intersections is not supported, requiring extra work for domain unions or differences.

Frequently Asked Questions

Quick Stats

Stars665
Forks67
Contributors0
Open Issues28
Last commit2 years ago
CreatedSince 2016

Tags

#meshing#scientific-computing#mathematics#mesh#python-library#mesh-generation#finite-element-analysis#engineering#python#cgal#computational-geometry

Built With

E
Eigen
C
CGAL
P
Python
m
meshio

Included in

Scientific Computing1.5k
Auto-fetched 1 day ago

Related Projects

pygmshpygmsh

:spider_web: Gmsh for Python

Stars968
Forks170
Last commit2 years ago
dmshdmsh

:spider_web: Simple mesh generator inspired by distmesh.

Stars222
Forks29
Last commit1 month ago
SeismicMeshSeismicMesh

2D/3D serial and parallel triangular mesh generation tool for finite element methods.

Stars142
Forks36
Last commit3 years ago
TetWildTetWild

Generate tetrahedral meshes for triangular surface meshes. (C++, GPL 3, GitHub)

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub