voronoi_edgesΒΆ

[1]:
import matplotlib.pyplot as plt
import numpy as np
import porespy as ps
import scipy

ps.visualization.set_mpl_style()
np.random.seed(10)

voronoi_edges creates a 3 dimensional image of the egdes of a voronoi tessellation with the shape, radius, and number of cells provided within the function inputs. The variable flat_faces is used to control if the faces of the tessellation are flat.

[2]:
shape = [200, 300, 400]
radius = 1
ncells = 200
flat_faces = True
[3]:
x = ps.generators.voronoi_edges(shape, radius, ncells, flat_faces)
gr = ps.visualization.show_3D(x)
plt.figure(figsize=[4, 4])
plt.axis(False)
fig = plt.imshow(gr);
../../../_images/examples_generators_howtos_voronoi_edges_4_0.svg

The image produced with flat_faces = True

[4]:
shape = [200, 300, 400]
radius = 1
ncells = 200
flat_faces = False
[5]:
x = ps.generators.voronoi_edges(shape, radius, ncells, flat_faces)
gr = ps.visualization.show_3D(x)
plt.figure(figsize=[4, 4])
plt.axis(False)
fig = plt.imshow(gr);
../../../_images/examples_generators_howtos_voronoi_edges_7_0.svg

The image produced with flat_faces = False