Cₖ(u) = ((R + a·cos wₖ)·cos u, (R + a·cos wₖ)·sin u, a·sin wₖ) · wₖ = ωu + 2πk/N
colour(k) = palette[(k + s) mod N] · s ← s + 1 per step
Line study / 19

Braided torus

Geometry & colour rule

N identical threads share one torus, evenly phased around the tube by 2π/N. Thread k is

C_k(u) = ((R + a cos w_k) cos u, (R + a cos w_k) sin u, a sin w_k)
w_k = ωu + 2πk/N

Each thread is drawn as a glowing polyline, split into short strokes and painted back to front by depth. There are no surfaces and no shading — only colour, glow and overlap.

The travel trick. Thread k wears palette entry (k + s) mod N; one step sets s ← s + 1. Since w_k(u + 2π/(Nω)) = w_k(u) + 2π/N = w_{k+1}(u), thread k+1 at u sits exactly where thread k sits a little further along the coil. Stepping the colour index therefore slides every colour band one thread forward along the braid, even though no point of geometry moves.

Drag to rotate · Scroll to zoom · Arrow keys to rotate