<p align="center">
<img src="https://github.com/3MAH/microgen/blob/main/docs/_static/microgen.png?raw=true" alt="Microgen logo" width="100%"/>
</p>
**Microgen** is a Python library designed to facilitate microstructure generation and meshing. Here are its core features:
- **Repeated cells**: Generation of lattice structures such as octet trusses and honeycombs.
- **Triply Periodic Minimal Surfaces (TPMS)**: TPMS-based lattice generation known for favorable physical (mechanical, thermal, ...) properties like low density and large surface area.
- **Virtual composites microstructures**: Generation of basic reinforcement geometries, including spheres, cylinders, ellipsoids, and more.
- **3D Voronoi tessellation**: Simulation of granular materials and polycrystalline metals.
- **Meshing**: Regular and **periodic** meshing using Gmsh, **remeshing** using Mmg.
Generation of 3D objects is achievable through functions that utilize Open CASCADE (via Cadquery) or VTK (using PyVista). Neper offers tools for 3D tessellation, while Gmsh handles the generation of both regular and periodic meshes, with Mmg handling remeshing tasks.
<p align="center">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/gyroid.gif" alt="Gyroid" width="49%"/>
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/fischerKoch.gif" alt="TPMS" width="49%"/>
</p>
| | |
| -------------- | ---------------- |
| PyPI package | [![PyPI](https://badge.fury.io/py/microgen.svg)](https://pypi.org/project/microgen/) |
| Conda forge package | [![Conda](https://anaconda.org/conda-forge/microgen/badges/version.svg)](https://anaconda.org/conda-forge/microgen) |
| Documentation | [![Documentation](https://readthedocs.org/projects/microgen/badge/?version=latest)](https://microgen.readthedocs.io/en/latest/?badge=latest) |
| Status | [![Status](https://github.com/3MAH/microgen/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/3MAH/microgen) |
| Citation | [![DOI](https://zenodo.org/badge/380437028.svg)](https://zenodo.org/badge/latestdoi/380437028) |
| License | [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) |
| Website | [![Website](https://img.shields.io/badge/website-3MAH-blue)](https://3mah.github.io/) |
| Binder | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/3MAH/microgen/HEAD?urlpath=lab%2Ftree%2Fexamples%2Fjupyter_notebooks) |
## Installation
With pip:
```bash
pip install microgen
```
With conda:
```bash
conda install conda-forge::microgen
```
-------------------------------------------------------------------------------------------------------
To modify the sources, clone this repository and install microgen:
```bash
git clone https://github.com/3MAH/microgen.git
cd microgen
pip install -e .[all]
pre-commit install
```
The `-e` or `--editable` option allows to modify the sources without having to reinstall the package and `[all]` installs the optional development dependencies.
Run tests with pytest:
```bash
pytest tests -n auto
```
## Examples
Click on the image to be redirected to the corresponding example on Microgen's documentation
### Basic shapes
<a href="https://microgen.readthedocs.io/en/latest/examples/basic_shapes.html#basic-shapes">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/shapes.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/basic_shapes.html#platon-polyhedra">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/platon.png" height="250">
</a>
### Repeated cells
<a href="https://microgen.readthedocs.io/en/latest/examples/lattices.html#octet-truss">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/octettruss.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/lattices.html#honeycomb">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/honeycomb.png" height="250">
</a>
### Triply Periodic Minimal Surfaces (TPMS)
<a href="https://microgen.readthedocs.io/en/latest/examples/tpms.html#gyroid">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/gyroid.png"height="250"></a>
<a href="https://microgen.readthedocs.io/en/latest/examples/tpms.html#tpms-available">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms.png" height="250"></a>
<a href="https://microgen.readthedocs.io/en/latest/examples/tpms.html#spherical-gyroid">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms_sphere.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/tpms.html#shell">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms_shell.png" height="250">
</a>
### 3D operations
<a href="https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#repeating-unit-geometry">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/repeated_geometry.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#raster-ellipsoid">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/rasterEllipsoid.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#voronoi">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Voronoi.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#voronoi-gyroid">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Gyroid-voro.png" height="250">
</a>
### Mesh
<a href="https://microgen.readthedocs.io/en/latest/examples/mesh.html#id1">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Mesh.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/mesh.html#periodic-mesh">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/meshPeriodic.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/mesh.html#mmg">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/mmg.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/mesh.html#mmg-voronoi">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/mmg-voro.png" height="250">
</a>
<a href="https://microgen.readthedocs.io/en/latest/examples/mesh.html#periodic-remeshing">
<img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/remeshed_mesh.png" height="250">
</a>
Raw data
{
"_id": null,
"home_page": null,
"name": "microgen",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "microstructure, lattice, periodic, TPMS, mesh",
"author": null,
"author_email": "3MAH <set3mah@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d6/78/fa0bafeb02ed6705367b57c76b2f279f505a66915a8343f658540a884ef9/microgen-1.2.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img src=\"https://github.com/3MAH/microgen/blob/main/docs/_static/microgen.png?raw=true\" alt=\"Microgen logo\" width=\"100%\"/>\n</p>\n\n**Microgen** is a Python library designed to facilitate microstructure generation and meshing. Here are its core features:\n\n- **Repeated cells**: Generation of lattice structures such as octet trusses and honeycombs.\n- **Triply Periodic Minimal Surfaces (TPMS)**: TPMS-based lattice generation known for favorable physical (mechanical, thermal, ...) properties like low density and large surface area.\n- **Virtual composites microstructures**: Generation of basic reinforcement geometries, including spheres, cylinders, ellipsoids, and more.\n- **3D Voronoi tessellation**: Simulation of granular materials and polycrystalline metals.\n- **Meshing**: Regular and **periodic** meshing using Gmsh, **remeshing** using Mmg.\n\nGeneration of 3D objects is achievable through functions that utilize Open CASCADE (via Cadquery) or VTK (using PyVista). Neper offers tools for 3D tessellation, while Gmsh handles the generation of both regular and periodic meshes, with Mmg handling remeshing tasks.\n\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/gyroid.gif\" alt=\"Gyroid\" width=\"49%\"/>\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/fischerKoch.gif\" alt=\"TPMS\" width=\"49%\"/>\n</p>\n\n| | |\n| -------------- | ---------------- |\n| PyPI package | [![PyPI](https://badge.fury.io/py/microgen.svg)](https://pypi.org/project/microgen/) |\n| Conda forge package | [![Conda](https://anaconda.org/conda-forge/microgen/badges/version.svg)](https://anaconda.org/conda-forge/microgen) |\n| Documentation | [![Documentation](https://readthedocs.org/projects/microgen/badge/?version=latest)](https://microgen.readthedocs.io/en/latest/?badge=latest) |\n| Status | [![Status](https://github.com/3MAH/microgen/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/3MAH/microgen) |\n| Citation | [![DOI](https://zenodo.org/badge/380437028.svg)](https://zenodo.org/badge/latestdoi/380437028) |\n| License | [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) |\n| Website | [![Website](https://img.shields.io/badge/website-3MAH-blue)](https://3mah.github.io/) |\n| Binder | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/3MAH/microgen/HEAD?urlpath=lab%2Ftree%2Fexamples%2Fjupyter_notebooks) |\n\n## Installation\n\nWith pip:\n\n```bash\npip install microgen\n```\n\nWith conda:\n\n```bash\nconda install conda-forge::microgen\n```\n\n-------------------------------------------------------------------------------------------------------\n\nTo modify the sources, clone this repository and install microgen:\n\n```bash\ngit clone https://github.com/3MAH/microgen.git\ncd microgen\npip install -e .[all]\npre-commit install\n```\n\nThe `-e` or `--editable` option allows to modify the sources without having to reinstall the package and `[all]` installs the optional development dependencies.\n\n\nRun tests with pytest:\n\n```bash\npytest tests -n auto\n```\n\n## Examples\n\nClick on the image to be redirected to the corresponding example on Microgen's documentation\n\n### Basic shapes\n\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/basic_shapes.html#basic-shapes\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/shapes.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/basic_shapes.html#platon-polyhedra\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/platon.png\" height=\"250\">\n</a>\n\n### Repeated cells\n\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/lattices.html#octet-truss\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/octettruss.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/lattices.html#honeycomb\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/honeycomb.png\" height=\"250\">\n</a>\n\n### Triply Periodic Minimal Surfaces (TPMS)\n\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/tpms.html#gyroid\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/gyroid.png\"height=\"250\"></a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/tpms.html#tpms-available\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms.png\" height=\"250\"></a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/tpms.html#spherical-gyroid\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms_sphere.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/tpms.html#shell\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/tpms_shell.png\" height=\"250\">\n</a>\n\n### 3D operations\n\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#repeating-unit-geometry\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/repeated_geometry.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#raster-ellipsoid\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/rasterEllipsoid.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#voronoi\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Voronoi.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/3d_operations.html#voronoi-gyroid\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Gyroid-voro.png\" height=\"250\">\n</a>\n\n### Mesh\n\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/mesh.html#id1\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Mesh.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/mesh.html#periodic-mesh\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/meshPeriodic.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/mesh.html#mmg\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/mmg.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/mesh.html#mmg-voronoi\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/mmg-voro.png\" height=\"250\">\n</a>\n<a href=\"https://microgen.readthedocs.io/en/latest/examples/mesh.html#periodic-remeshing\">\n <img src=\"https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/remeshed_mesh.png\" height=\"250\">\n</a>\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Microstructure generation and meshing",
"version": "1.2.1",
"project_urls": {
"Bug Tracker": "https://github.com/3MAH/microgen/issues",
"Documentation": "https://microgen.readthedocs.io/en/latest",
"Source Code": "https://github.com/3MAH/microgen"
},
"split_keywords": [
"microstructure",
" lattice",
" periodic",
" tpms",
" mesh"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "596b75cbfb60b1f5e413f9b9fea46044b7301b1dc23002ac4edf090afd0c9a89",
"md5": "79d52aa651d8494ad7716bb779732260",
"sha256": "5841ae607dd6917faafd3a61f5026f39d48a7350e32150eaf900572846a2558c"
},
"downloads": -1,
"filename": "microgen-1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79d52aa651d8494ad7716bb779732260",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 62320,
"upload_time": "2024-07-04T21:47:37",
"upload_time_iso_8601": "2024-07-04T21:47:37.432084Z",
"url": "https://files.pythonhosted.org/packages/59/6b/75cbfb60b1f5e413f9b9fea46044b7301b1dc23002ac4edf090afd0c9a89/microgen-1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d678fa0bafeb02ed6705367b57c76b2f279f505a66915a8343f658540a884ef9",
"md5": "27ce6794b744a0957662ac4cfdd05ad3",
"sha256": "8cb7a25bc260b13e92cbad1a45deb7bfce29516239499f4224defe2f4e98ac2d"
},
"downloads": -1,
"filename": "microgen-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "27ce6794b744a0957662ac4cfdd05ad3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 24329753,
"upload_time": "2024-07-04T21:47:39",
"upload_time_iso_8601": "2024-07-04T21:47:39.570761Z",
"url": "https://files.pythonhosted.org/packages/d6/78/fa0bafeb02ed6705367b57c76b2f279f505a66915a8343f658540a884ef9/microgen-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-04 21:47:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "3MAH",
"github_project": "microgen",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "microgen"
}