# Boy's Surface — `boy-surface@1.0.0`

The three-lobed, self-crossing Boy's surface turning in studio light under an iridescent, oil-slick skin. Loops perfectly.

Boy's surface, the strange self-crossing sheet that is the projective plane immersed in ordinary space, drawn from the Bryant–Kusner formula and turning slowly in the studio light. Its skin is iridescent, shifting colour like an oil film or soap bubble as it turns; a fine net of curves runs along it; a clear-coated sheen catches the softboxes. Choose the finish (iridescent, chrome, pearl or dark), whether the net of curves shows, the fineness of the mesh, how many turns it makes about each axis, the backdrop and whether the camera drifts.

- Kind: object; status: published; digest sha256:793e94f99601df6d3c17898c8cc9e8d9b2cea60ab6d4e2799755bd62f1b43ac6
- Role: Object (3D, three.js): a mathematical sculpture for maths, science, design and futuristic content.
- Implementation: three; entry `src/boy-surface.js`
- Files: https://aipixelwizard.com/registry/boy-surface/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/boy-surface.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/boy-surface/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/boy-surface/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer, geometry and shader materials.; `chrome-material@1.1.0` (demo) — Studio environment light, backdrop and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createBoySurface({ finish?, lines?, detail?, turnsX?, turnsY? }) => { group, setProgress(progress), dispose() }` — The surface (about 2 across) and its net of curves as a group; add it with an environment map and a light.
- `boyPoint(r, theta) => [x, y, z]` — A point of Boy's surface for w = r·e^(iθ) in the unit disc.
- `FINISHES: { iridescent, chrome, pearl, dark }` — Material settings.

## Parameters
- `finish` (select one of iridescent | chrome | pearl | dark, default "iridescent") — Finish
- `lines` (boolean, default true) — Net of curves
- `detail` (number 0.6–1.4, default 1) — Detail
- `turnsX` (integer 0–3, default 1) — Turns about x
- `turnsY` (integer 0–3, default 2) — Turns about y
- `background` (color, default "#1a2030") — Backdrop
- `orbit` (boolean, default true) — Camera drift

## Composition
- Inputs: Time within the loop; the finish, net of curves, detail, turns, backdrop and camera drift.
- Outputs: A full frame rendered in 3D with soft shadows and a studio environment.
- Coordinates: The surface is centred on the origin, about 2 across before scaling; the demo scales it by 1.45.
- Lighting: A warm key light with a shadow map and the studio environment on the clear-coated, thin-film surface.
- Timing: setProgress(progress) sets the rotation; frames render in any order.
- Works with: chrome-material, orbit-camera, kinetic-title, number-reveal
- The mesh is a 90 × 240 grid over the unit disc in the Bryant–Kusner parametrisation (w^6 + √5·w^3 − 1 in the denominator), its normals averaged where the rim meets itself; the net of curves is 8 circles and 24 spokes of the disc.

## Output and loop
- 1080×1080, 30 fps, 16 s, procedural
- Seamless loop: yes — The surface turns a whole number of times about x and y per loop and the camera drift is a sine of the loop, so the last frame meets the first.
- Verified 2026-10-05 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Create a WebGLRenderer with shadows and a studio environment (see chrome-material), add createBoySurface().group and call boy.setProgress(progress) each frame.

Existing project: Copy src/boy-surface.js; add boy.group to your scene with an environment map and a light.

Reuse ideas:
- Maths or topology explainer: Iridescent, with curves.
- Design-studio showpiece: Chrome, bare.
- Luxury abstract loop: Pearl.

## Limitations
- The surface crosses itself, so its inside and outside are both visible; the iridescence is the standard thin-film model, not a simulation.
- The mesh near the centre of the disc (the surface's tip) is slightly coarse.

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

Provenance: Adapted from the owner's threejs-sketches/geometry-math/boy-surface (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original object: the Bryant–Kusner parametrisation evaluated on a welded grid, an iridescent clear-coated skin and whole-turn rotation for an exact loop.

