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 0x7f64abd08b90>

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 0x7f64a7d01d10>

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));
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));