# Tube Lattice

Implicit · F(x, y, z, t) = 0

`0 = 10(cos x + cos y + cos z) − 5.1(cos(x) · cos y + cos(y) · cos z + cos(z) · cos x) − 14.6`

[Open in the app](https://www.wavelace.com/app#p=184) · [This page](https://www.wavelace.com/presets/tube-lattice)

### What it draws

A cubic lattice of tubes. There is a joint wherever `x`, `y` and `z` are all multiples of `2π ≈ 6.28`, and a tube along every line from a joint to its neighbour. The cube is 13 across, just over two periods, so it holds 27 joints.

The first sum, `10(cos x + cos y + cos z)`, peaks at 30 on the joints. The second subtracts 5.1 times the cosines multiplied two at a time. The last number, 14.6, is the level: the surface is where the first two together equal it.

### Why tubes

On the x axis `cos y` and `cos z` are both 1, and the formula collapses to `0.3 − 0.2 cos x`. That is 0.1 at a joint and 0.5 halfway to the next one. It is positive all the way, so the whole line lies inside the surface.

The 10 and twice the 5.1 nearly cancel, which is what keeps the line inside. A step sideways and the value falls fast: halfway along, the tube is about 0.32 in radius. At a joint, where three lines cross, the surface swells to about 0.8 from the centre.

The margin at a joint is thin. With 14.7 in place of 14.6 the value there is exactly 0, and each joint pinches to a point.

### A relative of Schwarz's P

Without the products and at level 0, `cos x + cos y + cos z = 0` is the usual approximation to Schwarz's P surface. Hermann Schwarz described that surface in 1865, among the first minimal surfaces known to repeat in three directions. Alan Schoen named this one P, for primitive, in 1970: it splits space into two alike labyrinths, each an inflated cubic lattice of tubes. Here the level is far higher, and the products keep one labyrinth joined while it thins to tubes.

### Try

- Change the 5.1 to 0: without the products the tubes are gone, and 27 separate blobs are left, one round each joint.
- Change the 14.6 to 12: a lower level fattens the tubes, to a radius of 0.81 halfway along.
- Change the 14.6 to 14.9: the joints are gone, and each tube has shrunk to a spindle `π ≈ 3.14` long.
- Set `Span of x, y, z` to 3.5: one joint and its six arms, each cut just past its halfway point.

### Read more

- [Schwarz minimal surface](https://en.wikipedia.org/wiki/Schwarz_minimal_surface)
- [Triply periodic minimal surface](https://en.wikipedia.org/wiki/Triply_periodic_minimal_surface)
- [Level set](https://en.wikipedia.org/wiki/Level_set)
- [Implicit surface](https://en.wikipedia.org/wiki/Implicit_surface)
