class Delaunay(*args, **kwargs)[source]


Random network formed by Delaunay tessellation of arbitrary base points

  • points (array_like or int) – Can either be an N-by-3 array of point coordinates which will be used, or a scalar value indicating the number of points to generate

  • shape (array_like) –

    The size of the domain. It’s possible to create cubic as well as 2D square domains by changing the shape as follows:

    [x, y, z] - will produce a normal cubic domain of dimension x, and and z

    [x, y, 0] - will produce a 2D square domain of size x by y

  • name (string) – An optional name for the object to help identify it. If not given, one will be generated.

  • project (OpenPNM Project object, optional) – Each OpenPNM object must be part of a Project. If none is supplied then one will be created and this Network will be automatically assigned to it. To create a Project use openpnm.Project().


This class always performs the tessellation on the full set of points, then trims any points that lie outside the given domain shape.


>>> import numpy as np
>>> import scipy as sp
>>> import openpnm as op
>>> import matplotlib as mpl
>>> mpl.use('Agg')

Supplying custom specified points:

>>> pts = np.random.rand(200, 3)
>>> gn =, shape=[1, 1, 1])
>>> gn.Np

Which can be quickly visualized using:

>>> fig = op.topotools.plot_connections(network=gn)

Upon visualization it can be seen that this network is not very cubic. There are a few ways to combat this, but none will make a truly square domain. Points can be generated that lie outside the domain shape and they will be automatically trimmed.

>>> pts = np.random.rand(300, 3)*1.2 - 0.1  # Must have more points for same density
>>> gn =, shape=[1, 1, 1])
>>> gn.Np < 300  # Confirm base points have been trimmed

And visualizing:

>>> fig = op.topotools.plot_connections(network=gn)

If a domain with random base points but flat faces is needed use Voronoi.