The geometry

← back to the demo · icon library · tables · about

The horn torus

A torus is the shape of a doughnut: a tube bent into a ring. It has two radii, the ring radius R and the tube radius r. When R is bigger than r there is a hole in the middle. When R equals r the hole closes completely and the inner edge pinches to a single point. That is the horn torus. Every line of the surface passes through that one centre point.

P(u,v) = ( R(1 + cos v) cos u,  R sin v,  R(1 + cos v) sin u )   with R = r

u runs the long way around the ring, v runs around the tube. The demo checks itself against this formula: every vertex sits within about 10⁻¹⁵ of the exact surface, and the horn row collapses to the centre to the same precision.

Why 12 × 24

The lattice is 12 rows by 24 columns, 288 cells. The 2:1 ratio is not a preference. The outer equator of a horn torus is twice as long as a path around the tube, so two columns for every row keeps the cells close to square where they are most visible. It is a property of the shape.

The fold

Think of rolling a beach towel. First you curl it into a tube. Then you bend the tube around until its two ends meet, making a ring. Then the ring tightens until the hole in the middle closes to a point. The demo does exactly this in three stages named Curl, Ring and Pinch, and the Master slider runs the first two in order. Folding this way means the surface never has to pass through itself, which a straight-line morph would do.

Gores

If you slice a globe's paper map so it lies flat, you get lens-shaped strips called gores, like the segments of a peeled orange. The same is true here in reverse: the flat sheet is shaped into 24 lens strips whose tips meet at the horn, so every cell keeps its size when the sheet closes into the torus.

Addresses

Each cell has a number from 1 to 288, counted along each row. The same number names both faces of the cell, and a letter says which face you mean. O is the exterior, the observer's view. I is the interior, the personal view. Seven shells nested inside each other multiply that out to 4,032 addresses in one structure.

The two faces are treated as two registers of one cell: the exterior as public and permissioned, the interior as private and encrypted. The demo only renders labels; it stores nothing.

One texture per face

Rather than giving all 4,032 addresses their own material, each shell's face carries a single texture atlas holding all 288 labels. Seven shells with two faces each is 14 draw calls, which is why the whole stack stays smooth.

© Luke Nathan Hayes · Public Source Licence: non-commercial use free, commercial rights reserved.