# Torus Wave Loop — `torus-wave@1.1.0`

Glowing rings around a slowly turning doughnut, with a wave rippling through them. Loops seamlessly.

Dozens of thin neon rings sit around a doughnut shape. A wave swells through them while the whole form turns, creating that calm, mesmerising wireframe look. Pick two colours, the number of rings and waves, and how much they swell. Everything is drawn as simple lines, so it stays crisp at any size.

- Kind: effect; status: published; digest sha256:5c48a571a3815a9a7b5b9ba61321325a5a380ace2aff7f6683a6d44ee20e9241
- Role: Hero loop or background (Canvas 2D layer).
- Implementation: canvas2d; entry `src/torus-wave.js`
- Files: https://aipixelwizard.com/registry/torus-wave/1.1.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/torus-wave.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/torus-wave/versions/1.1.0
- Runnable demo: https://aipixelwizard.com/registry/torus-wave/1.1.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `apw-runtime@1.0.0` (demo) — Demo harness. src/torus-wave.js has no dependencies.

## Exports
- `createTorusWave({ rings?, waves?, cycles?, spins?, amplitude?, tilt?, colorA?, colorB?, lineWidth?, scale? }) => { draw(ctx, info, width, height) }` — Canvas 2D layer; draws additively.

## Parameters
- `rings` (integer 12–140, default 44) — Rings
- `waves` (integer 1–8, default 3) — Waves: Number of swells around the doughnut.
- `speed` (integer 1–4, default 1) — Wave speed: Wave cycles per loop.
- `spins` (integer 0–2, default 1) — Turns: Turns of the doughnut per loop.
- `swell` (number 0–0.9, default 0.32) — Swell
- `tilt` (number 0–1.5, default 1.15) — Tilt
- `colorA` (color, default "#ff4fd8") — Colour A
- `colorB` (color, default "#4fd6ff") — Colour B
- `lineWidth` (number 0.3–3, default 1.6) — Line weight
- `background` (color, default "#07060f") — Background

## Composition
- Inputs: Canvas 2D context, info.progress, width, height.
- Outputs: Additive line drawing centred on the canvas. Does not clear the canvas.
- Coordinates: Centred; size is 27% of the shorter side × scale.
- Lighting: Additive blending; use a dark background.
- Timing: Pure function of progress.
- Works with: gradient-background, kinetic-title

## Output and loop
- 1080×1080, 30 fps, 8 s, procedural
- Seamless loop: yes — Whole wave cycles and whole turns per clip.
- Verified 2026-10-03 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (Canvas 2D); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Create a 2D canvas; each frame fill the background and call torus.draw(ctx, { progress }, width, height).

Existing project: Copy src/torus-wave.js and call draw from your existing frame loop between your background and foreground.

Reuse ideas:
- Draw it small (scale 0.4) in a corner as an animated logo mark.
- Use one colour and spins 0 as a calm breathing loader.
- Layer it over Soft Gradient Background for a richer backdrop.

## Limitations
- Lines are not depth-sorted; additive blending hides most of this.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.

Provenance: Original code written for AI Pixel Wizard in October 2026. Demo rebuilt in October 2026 to the catalog quality bar (docs/QUALITY.md).

