{
  "schemaVersion": 1,
  "id": "klein-bottle",
  "version": "1.0.0",
  "status": "published",
  "kind": "object",
  "title": "Klein Bottle",
  "summary": "A glossy Klein bottle with no inside or outside, turning while a cutting plane sweeps through it to show how the tube threads itself. Loops perfectly.",
  "description": "The Klein bottle: a surface with no inside and no outside, whose neck bends back and passes through its own wall to join its base. Shown in its figure-eight form as a glossy shell turning in studio light while a cutting plane sweeps through it again and again, opening the surface so you can see how the tube threads itself. Choose the finish (iridescent, chrome, glass or gold), whether a net of curves lies on the surface, the mesh fineness, how far the cut sweeps (or none), the turns per loop, the size of the ring, the backdrop colour and whether the camera sways.",
  "role": "Object (3D, three.js): a topology showpiece for maths, science and design content.",
  "collections": [
    "chrome-glass",
    "hypnotic-loops",
    "product-reveals"
  ],
  "tags": [
    "klein bottle",
    "topology",
    "non-orientable",
    "surface",
    "mathematics",
    "figure eight",
    "iridescent",
    "geometry",
    "studio",
    "loop",
    "3d"
  ],
  "synonyms": [
    "klein surface",
    "non-orientable surface",
    "topological bottle",
    "maths sculpture",
    "one-sided surface",
    "figure-8 klein"
  ],
  "useCases": [
    "A maths or topology explainer",
    "A science-museum or design-studio title scene",
    "An abstract iridescent showpiece"
  ],
  "featured": null,
  "publishedAt": "2026-10-05",
  "implementation": {
    "target": "three",
    "runtime": "browser",
    "language": "javascript",
    "module": "esm",
    "entry": "src/klein-bottle.js",
    "exports": [
      {
        "name": "createKleinBottle",
        "signature": "createKleinBottle({ finish?, lines?, detail?, cut?, turns?, waist? }) => { group, setProgress(progress), dispose() }",
        "description": "The bottle (about 5 across, centred on the origin) with its cutting plane; the renderer needs localClippingEnabled = true; needs an environment map."
      },
      {
        "name": "FINISHES",
        "signature": "FINISHES: { iridescent, chrome, glass, gold }",
        "description": "Surface finishes: colour, metalness, roughness, iridescence and film index."
      }
    ],
    "reusable": [
      "src/klein-bottle.js"
    ],
    "demo": "demo.js",
    "harness": "index.html"
  },
  "dependencies": [
    {
      "id": "three",
      "version": "0.185.1",
      "reason": "Renderer, geometry and shader materials."
    },
    {
      "id": "chrome-material",
      "version": "1.1.0",
      "scope": "demo",
      "reason": "Studio environment light, backdrop and contact shadow."
    },
    {
      "id": "apw-runtime",
      "version": "1.0.0",
      "scope": "demo",
      "reason": "Demo harness."
    }
  ],
  "params": [
    {
      "key": "finish",
      "label": "Finish",
      "type": "select",
      "default": "iridescent",
      "options": [
        {
          "value": "iridescent",
          "label": "Iridescent"
        },
        {
          "value": "chrome",
          "label": "Chrome"
        },
        {
          "value": "glass",
          "label": "Glass"
        },
        {
          "value": "gold",
          "label": "Gold"
        }
      ]
    },
    {
      "key": "lines",
      "label": "Surface lines",
      "type": "boolean",
      "default": true
    },
    {
      "key": "detail",
      "label": "Mesh detail",
      "type": "number",
      "min": 0.6,
      "max": 1.4,
      "step": 0.1,
      "default": 1
    },
    {
      "key": "cut",
      "label": "Cutting plane",
      "help": "How far the plane sweeps; 0 leaves the bottle whole.",
      "type": "number",
      "min": 0,
      "max": 1,
      "step": 0.1,
      "default": 1
    },
    {
      "key": "turns",
      "label": "Turns per loop",
      "type": "integer",
      "min": 0,
      "max": 3,
      "step": 1,
      "default": 1
    },
    {
      "key": "waist",
      "label": "Ring size",
      "type": "number",
      "min": 1.6,
      "max": 3,
      "step": 0.1,
      "default": 2
    },
    {
      "key": "background",
      "label": "Backdrop",
      "type": "color",
      "default": "#141824"
    },
    {
      "key": "orbit",
      "label": "Camera sway",
      "type": "boolean",
      "default": true
    }
  ],
  "presets": [
    {
      "id": "default",
      "label": "Iridescent, cut",
      "params": {}
    },
    {
      "id": "chrome",
      "label": "Chrome, whole",
      "params": {
        "finish": "chrome",
        "cut": 0,
        "lines": false,
        "background": "#10141c"
      }
    },
    {
      "id": "glass",
      "label": "Glass, two turns",
      "params": {
        "finish": "glass",
        "turns": 2,
        "background": "#0c1620"
      }
    },
    {
      "id": "gold",
      "label": "Gold, wide ring",
      "params": {
        "finish": "gold",
        "waist": 2.8,
        "background": "#241a12"
      }
    }
  ],
  "output": {
    "width": 1080,
    "height": 1080,
    "fps": 30,
    "durationSeconds": 16,
    "posterSeconds": 1,
    "alpha": false,
    "motion": "procedural",
    "loop": {
      "seamless": true,
      "cycleSeconds": 16,
      "method": "The surface turns a whole number of times per loop, the cutting plane's position is a sine of whole cycles and the camera sway is a sine of the loop, so the last frame meets the first."
    },
    "seed": null
  },
  "composition": {
    "inputs": "Time within the loop; the finish, lines, detail, cut, turns, ring size, backdrop and camera sway.",
    "outputs": "A full frame rendered in 3D with a studio environment.",
    "coordinates": "The bottle is centred on the origin, about 5 across, hung 3.3 above the floor; the cutting plane is perpendicular to x in world space and starts clear of the bottle and sweeps in to cut away about two-thirds of it, twice per loop.",
    "lighting": "A warm key light with a shadow map and the studio environment.",
    "timing": "setProgress(progress) sets the turn and the plane; frames render in any order.",
    "compatibleWith": [
      "chrome-material",
      "orbit-camera",
      "kinetic-title",
      "number-reveal"
    ],
    "notes": [
      "The mesh is built once; clipping happens on the GPU."
    ]
  },
  "reuse": [
    "Maths explainer: Iridescent, cut.",
    "Product-style: Chrome, whole.",
    "Calm: Glass, two turns."
  ],
  "integration": {
    "newProject": "Create a WebGLRenderer with localClippingEnabled = true and a studio environment, add createKleinBottle().group and call bottle.setProgress(progress) each frame.",
    "existingProject": "Copy src/klein-bottle.js; enable localClippingEnabled on your renderer and add the group to your scene with an environment map."
  },
  "performance": {
    "notes": "A single static mesh of about 32 000 triangles with GPU clipping and a shadow map: a couple of milliseconds a frame on an integrated Intel GPU.",
    "limits": "Software WebGL renders in about two seconds a frame."
  },
  "limitations": [
    "A Klein bottle cannot exist in three dimensions without passing through itself: the figure-eight form intersects itself along a circle.",
    "The glass finish is transparent without true refraction."
  ],
  "license": {
    "spdx": "MIT",
    "notice": "Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.",
    "thirdParty": []
  },
  "provenance": "Adapted from the owner's threejs-sketches/geometry-math/klein-bottle (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: the figure-eight immersion as a static mesh with seam-averaged normals, a world-space cutting plane sweeping in a sine of the loop and an iridescent finish, on an exact loop.",
  "changelog": [
    {
      "version": "1.0.0",
      "date": "2026-10-05",
      "notes": "Initial release."
    }
  ]
}
