A pure Python mesh generator for 2D geometries, inspired by distmesh, with a user-friendly interface and high-quality output.
dmsh is a Python library for generating 2D triangular meshes from geometric shapes. It solves the problem of creating discretized domains for simulations, visualization, or finite element analysis by providing an intuitive API to define geometries and produce high-quality meshes. Inspired by distmesh, it trades performance for ease of use and pure Python compatibility.
Researchers, engineers, and developers working in computational geometry, finite element method (FEM) simulations, or scientific computing who need a straightforward way to generate 2D meshes without complex setup.
Developers choose dmsh for its pure Python implementation, which ensures easy installation and cross-platform compatibility, and its user-friendly interface that simplifies mesh generation from geometric primitives and boolean operations.
:spider_web: Simple mesh generator inspired by distmesh.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Shapes are defined using simple classes like Circle and Rectangle, and boolean operations use operators (+, -, &) for union, difference, and intersection, making the code readable and easy to write, as shown in the examples.
As a pure Python package, it can be installed via pip without external dependencies, ensuring compatibility across different operating systems, highlighted in the installation section.
When paired with optimesh, dmsh produces meshes with excellent element quality, suitable for finite element analysis where mesh quality is critical, as stated in the README.
Supports variable edge length functions based on distance to geometric features, allowing finer meshing near boundaries for improved accuracy, demonstrated in the local refinement examples.
Includes methods like geo.show() to visualize level-set functions for geometry validation, helping debug incorrectly defined domains, as mentioned in the debugging section.
The README admits it's slow and memory-intensive, making it inefficient for generating large or complex meshes compared to compiled alternatives like Gmsh or distmesh in other languages.
It can break down with incorrectly defined geometries or tolerances, requiring careful debugging and validation, as highlighted by the debugging tools and warnings in the examples.
Only supports 2D triangular meshes, so it cannot handle 3D applications, which is a significant limitation for many engineering and simulation workflows.