microgen

Microstructure generation and periodic meshing for the mechanics of architectured materials.

Gyroid whose density is graded from a thin sheet to a dense block, generated with microgen

microgen generates triply periodic minimal surfaces, strut lattices, Voronoi polycrystals and composite inclusions as implicit fields or CAD solids, and meshes them with conforming, periodic tetrahedral meshes ready for homogenization with fedoo and simcoon.

What you can build

Triply periodic minimal surfaces

Gyroid, Schwarz, Schoen, Neovius, Fischer-Koch and more, as sheets or skeletals, at a prescribed density.

Available TPMS
Grading and morphing

Density and cell-size gradients, morphing between TPMS families, cylindrical, spherical and swept frames.

Density grading
Spinodoids

Periodic Gaussian random fields at a prescribed density, isotropic, columnar or lamellar.

Spinodoid
Strut lattices

Twelve preset lattices, custom and auxetic cells, octet-truss and honeycomb.

Preset strut lattices
Voronoi polycrystals

Neper tessellations as polyhedral grains, alone or intersected with a TPMS.

Voronoi polycrystal
Particle and fibre RVEs

Random, non-overlapping spheres and short fibres with their periodic images.

Periodic RVE of short fibres
Periodic meshes

Conforming tetrahedral meshes with matching nodes on opposite faces (gmsh), remeshing with mmg.

Periodic octet-truss mesh
Implicit booleans

Every shape is a signed field: union, intersection, difference and smooth blends are instant, robust and need no CAD kernel.

Boolean operations on implicit fields
Measured microstructures

15 000 fibres rebuilt from a tomography analysis of a short fibre composite.

Short fibre composite

Hello, gyroid

from microgen import Phase, Tpms, surface_functions

gyroid = Tpms(surface_function=surface_functions.gyroid, offset=0.3)
phase = Phase.from_shape(gyroid, resolution=80)

phase.surface_mesh().save("gyroid.stl")  # marching cubes from the field
print(f"COM = {phase.center_of_mass}, pieces = {len(phase.pieces)}")

A Phase built with from_shape() carries the implicit field: marching cubes, connected components and moments are computed from the field, without the CAD backend. The CAD representation (STEP export, periodic gmsh meshes) is built on demand and needs the [cad] extra.

Install

pip install microgen            # implicit fields and surface meshes
pip install "microgen[cad]"     # + OCCT: CAD export, periodic meshes
conda install -c conda-forge microgen        # core
conda install -c conda-forge microgen ocp    # core + CAD

See Install for the details of each mode.

The 3MAH ecosystem

microgen

Geometry and periodic meshes of microstructures.

fedoo

Nonlinear finite elements and periodic homogenization.

https://3mah.github.io/fedoo-docs/
simcoon

Constitutive laws and mean-field micromechanics.

https://3mah.github.io/simcoon-docs/

Cite microgen

If you use microgen in academic work, please cite the concept DOI 10.5281/zenodo.6793573, which always resolves to the latest release. microgen is developed by the 3MAH group and external collaborators, under the GPL-3.0 license.