SkillAgentSearch skills...

Microgen

Microstructure generation

Install / Use

/learn @3MAH/Microgen
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<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 | | Conda forge package | Conda | | Documentation | Documentation | | Status | Status | | Citation | DOI | | License | License | | Website | Website | | Binder | Binder |

Installation

With pip:

pip install microgen

With conda:

conda install conda-forge::microgen

To modify the sources, clone this repository and install microgen:

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:

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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/examples/lattices.html#honeycomb"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/honeycomb.png" height="250"> </a>

Strut-based Lattices

<a href="https://3mah.github.io/microgen-docs/examples/lattices.html#preset-strut-based-lattices"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/lattices.png" height="250"> </a> <a href="https://3mah.github.io/microgen-docs/examples/lattices.html#custom-strut-based-lattices"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/auxetic_custom_lattice.png" height="250"> </a>

Triply Periodic Minimal Surfaces (TPMS)

<a href="https://3mah.github.io/microgen-docs/examples/tpms.html#gyroid"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/gyroid.png"height="250"></a> <a href="https://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/examples/mesh.html#id1"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/Mesh.png" height="250"> </a> <a href="https://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/examples/mesh.html#mmg"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/mmg.png" height="250"> </a> <a href="https://3mah.github.io/microgen-docs/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://3mah.github.io/microgen-docs/examples/mesh.html#periodic-remeshing"> <img src="https://raw.githubusercontent.com/3MAH/microgen/main/docs/_static/examples/remeshed_mesh.png" height="250"> </a>
View on GitHub
GitHub Stars95
CategoryDevelopment
Updated6d ago
Forks9

Languages

Python

Security Score

95/100

Audited on Mar 24, 2026

No findings