tpms_unit_cell#

import porespy as ps
import matplotlib.pyplot as plt
import numpy as np

ps.visualization.set_mpl_style()

shape#

This indicates the number of voxels in each direction. The function produces a unit cell, this effectively controls the resolution or fidelity of the result.

im1 = ps.generators.tpms_unit_cell(shape=100)
im2 = ps.generators.tpms_unit_cell(shape=200)

fig, ax = plt.subplots(1, 2, figsize=[8, 4])
ax[0].imshow(im1[int(im1.shape[0]/2), ...])
ax[1].imshow(im2[int(im2.shape[0]/2), ...])
<matplotlib.image.AxesImage at 0x7fdad6108f50>
../../../_images/b2b4dcba2a303a8c1a9e3062721700959583481cbeacfd36833bfaf3ec7dd160.png

method#

Several different structures are supported. The desired structure can be specified using the method argument:

im1 = ps.generators.tpms_unit_cell(shape=200, method='neovius')
im2 = ps.generators.tpms_unit_cell(shape=200, method='FKS')

fig, ax = plt.subplots(1, 2, figsize=[8, 4])
ax[0].imshow(ps.visualization.sem(im1))
ax[1].imshow(ps.visualization.sem(im2))
<matplotlib.image.AxesImage at 0x7fdad3b2d310>
../../../_images/b86f4bf951f8da579b0b338f92a84b882f2086d75d9ae1376b995503b5cf4a0c.png

phi and skew#

These parameters control the thickness of the wall and the shape of the output:

im1 = ps.generators.tpms_unit_cell(shape=200, phi=0.3)
im2 = ps.generators.tpms_unit_cell(shape=200, phi=0.5)

fig, ax = plt.subplots(1, 2, figsize=[8, 4])
ax[0].imshow(ps.visualization.sem(im1))
ax[1].imshow(ps.visualization.sem(im2));
../../../_images/434aa73b98f4ae5561cbc76ec381719709391bb1dfc287d541ef76be8637ea54.png
im1 = ps.generators.tpms_unit_cell(shape=200, skew=0.3)
im2 = ps.generators.tpms_unit_cell(shape=200, skew=0.6)

fig, ax = plt.subplots(1, 2, figsize=[8, 4])
ax[0].imshow(ps.visualization.sem(im1))
ax[1].imshow(ps.visualization.sem(im2));
../../../_images/74d66dbfe9db91d6c19492d8ff8de2a63cb415b36858f874fdf285be63bf6ce7.png