Porosity doesn't tell you whether the pores connect

Rock, soil, bone, bread and filters are all partly empty space, and what gets through them depends on whether that space joins up. In one random block with 13% pores, none of that space connects top to bottom. Raise it to 14% and 70% of it does.

Published
19 November 2026
Samples
Twelve generators from PoreSpy 3.3, up to 8 million voxels
Measures
Porosity, connection, pore size, chords, correlation
Exports
.npy, .tif and the PoreSpy call
Download
About 210 KB, plus the typeface
Open pores Source code on GitHub Based on PoreSpy on GitHub
Contents
  1. Where the pores join up
  2. Twelve ways to build a sample
  3. What the label records
  4. A problem with fibres, found by testing
  5. Taking a sample back to Python
  6. Limits
  7. Further reading

Porosity, the empty share of a material, is the first number anyone quotes about a sandstone, a soil, a bone or a filter. It says how much fluid the material could hold. It says nothing about whether any could pass through. For that you need the shape of the pores, usually from an X-ray scan: a 3D grid of voxels, every one marked pore or solid.

You can also make such a grid from a recipe. PoreSpy, the open-source Python toolkit for porous-media images, has generators that build artificial structures with known statistics, to test a method, train a model or stand in for a material nobody has made or scanned. pores runs twelve of them in 3D, with a label beside the sample giving what was measured.

Where the pores join up

The simplest random material starts as noise. Blur it, cut it at the level that leaves the porosity you asked for, and you have blobs, which look like sandstone or sintered powder. pores opens on a block 128 voxels a side at a porosity of 0.5, and all of its pore space connects the bottom face to the top.

Now lower the porosity. At 0.18, 91% of the pore space still connects. At 0.14 it is 70%. At 0.13 it is zero: plenty of pores remain, but no path crosses the block.

The jump moves from sample to sample. Over seeds 1 to 10, no block connects at 0.11 and all ten do at 0.17. Seed 10 holds out longest, with nothing connected at 0.16 and 70% one point later. A block of another size or blobiness would jump somewhere else, which is a good reason to make more than one.

A structure can also have pores at every scale and no way through. The Sierpinski foam, as it first appears in the app, is a solid with cubic holes cut at four scales. It is 15.6% pore, more than enough to connect the first blob sample, and none of it connects. Add a fifth level and the porosity rises to 19.6%, still with no path.

Twelve ways to build a sample

The generators lie in a tray under the sample, with a small cube made by each.

  • Blobs and fractal noise cut random fields at a level. Fractal noise adds several scales, for rougher pores.
  • Overlapping and polydisperse spheres fall at random, free to overlap, in one size or several. Much about this old model is known exactly.
  • Random packing places spheres wherever they fit without overlap until no room is left. With the default settings 323 fit, leaving 67.6% empty. Gravity packing fills from the floor up, as in a packed column, gets 474 into an equal box and leaves 52.5%.
  • Fibres lie in layers like paper or felt unless allowed to tilt. Voronoi foam thickens the edges of a random tessellation into struts, like an open-cell metal foam.
  • Sphere lattices come in three cubic packings. TPMS sheets follow periodic minimal surfaces such as Schoen’s gyroid, used in 3D-printed heat exchangers. Sierpinski foam and Cantor dust have holes at many scales.

What the label records

Connection is the share of pore space joined to both the bottom and top faces through neighbouring voxel faces. Pore size is the local thickness, the radius of the largest sphere that covers a pore voxel and still fits in the pore. You can colour the slice by it.

Two curves describe the texture. The two-point correlation, the chance that two points some distance apart are both pore, starts at the porosity and falls to its square where the structure forgets itself. Chord lengths count straight runs through pore along the three axes. A profile of porosity by height shows layering, such as the ordered first layers of a gravity packing against its floor.

The 3D view smooths the voxels into a surface, about 840,000 triangles for the opening block with its corner cut away. All measurements and downloads use the voxels themselves.

A problem with fibres, found by testing

PoreSpy 3.3 was the reference while porting. The distance transform, three sphere lattices, five minimal surfaces and the Sierpinski foam give checksums identical to its own, with non-cubic shapes among the tests. The blur behind blobs agrees to one part in 10¹², and local thickness gives an identical histogram of sizes on the test images.

Random generators draw different numbers, which rules out a voxel match. For six of them the mean porosity over twelve samples is held to PoreSpy’s within three standard errors plus 0.003, and the blobs’ two-point correlation, averaged over four samples, to within 0.03 at every distance out to 16 voxels.

Testing the fibres turned up a problem in PoreSpy itself. It adds them in three batches, sizing them from the volume per fibre so far, and lands about 0.02 short of the porosity requested on average. When the small first batch barely touches the image, the estimate collapses and the next batch overshoots badly. In forty seeds, one run stopped with a division by zero. pores adds one fibre at a time until it reaches the target, and is tested against that target.

Two other generators differ by design. Voronoi struts are found from a voxel’s three nearest seeds, with a width chosen to match PoreSpy’s edge volume; porosities agree to 0.004. Fractal noise uses its own simplex noise in place of FastNoiseSIMD and is not compared.

Taking a sample back to Python

The app writes out the PoreSpy call for whatever is on screen. A given seed makes different voxels there, with matching statistics, because the random streams differ. To keep this exact sample, download it as a NumPy array, True for pore, or as a TIFF stack that opens in Fiji.

Limits

These are idealised structures, measured in voxels: give a voxel a size before comparing one with a real material. Connection is not permeability, and a connected path may be very narrow. PoreSpy itself goes much further, to pore networks for OpenPNM, mercury intrusion and tortuosity. For the last of these, gtrax takes one of these images, or a scan, and measures it with random walkers.

Further reading