Software Open Access

Kanapy: Synthetic polycrystalline microstructure generator with geometry and texture

Biswas, Abhishek; R.G. Prasad, Mahesh; Vajragupta, Napat; Hartmaier, Alexander

Kanapy is a python package for generating complex synthetic polycrystalline microstructures. The general implementation is done in Python with the performance critical part for the geometry module implemented in C++. The Python bindings for the code written in C++ are generated using the lightweight header-only library pybind11. The C++ part of the implementation utilizes the Eigen library for efficient linear algebra calculations. The texture module of Kanapy is implemented as MATLAB functions. It also utilizes several algorithms implemented in MTEX for texture analysis.

In Kanapy-v1, an efficient modeling strategy for generating the geometry of the synthetic microstructures using statistical data was presented. Some of the novel features provided include: modeling complex microstructures consisting of irregular grain shapes, particle (grain) packing through collision detection and response system, and collision handling through a two-layer collision detection scheme. Synthetic microstructures are a key aspect of the micromechanical modeling approach for the prediction of mechanical properties. Apart from microstructure geometry, a vital component of polycrystalline microstructures that has substantial influence on the material behavior is texture. Therefore, a synthetic microstructure can be considered incomplete without the information of texture. This is addressed in the current version of Kanapy by including new efficient texture reduction and orientation assignment algorithms to the already existing package.
Files (46.9 MB)
Name Size
46.9 MB Download
  • Biswas, A., Vajragupta, N., Hielscher, R. & Hartmaier, A. (2020). J. Appl. Cryst. 53, 178-187.

  • Biswas, Abhishek, et al. "Influence of Microstructural Features on the Strain Hardening Behavior of Additively Manufactured Metallic Components." Advanced Engineering Materials 21.7 (2019): 1900275.

  • Prasad et al., (2019). Kanapy: A Python package for generating complex synthetic polycrystalline microstructures. Journal of Open Source Software, 4(43), 1732,

All versions This version
Views 311249
Downloads 2314
Data volume 1.0 GB656.5 MB
Unique views 246199
Unique downloads 2013


Cite as