Overview

Microgen is a simple python library that helps to generate and mesh microstructures.

Here are the main features: - Entirely written in Python 3, built on PyVista for implicit (F-rep) shapes and mesh I/O, with optional Open CASCADE via cadquery-ocp-novtk for BREP CAD output (pip install 'microgen[cad]'). - Implicit-first: every shape carries a scalar field, and microgen.Phase is field-first — Phase.from_shape() lets you mesh, sample, and partition without ever touching CAD. - It allows to generate simple reinforcement geometries (spheres, cylinder, ellipsoids, …) to generate virtual composites microstructures. - Three-dimensional Voronoi tessellation allows to simulate the response of granular materials and polycrystalline metals. - Regular mesh and periodic mesh are implemented using Gmsh, remeshing using Mmg is also implemented.

https://anaconda.org/set3mah/microgen/badges/version.svg https://badge.fury.io/py/microgen.svg

Gyroid TPMS

Brief examples

import microgen

geometry = microgen.Tpms(
   surface_function=microgen.surface_functions.gyroid,
   offset=0.3
)
shape = geometry.sheet

shape.plot(color='white')
_images/Overview_1_0.png