{
  "schemaVersion": 1,
  "id": "cable-knit",
  "version": "1.0.0",
  "status": "published",
  "kind": "object",
  "title": "Cable Knit",
  "summary": "Chunky wool knits itself row by row, with a braided cable down the middle, then draws back into the needles. Loops perfectly.",
  "description": "Chunky wool knitting itself: two bright needles click along the top of a growing piece of fabric while, row after row, stitches appear behind them, each a V of plump yarn with a twist of its own, the edges in rib and the middle braided into a rope of cables that cross every twelve rows. When the piece is finished the yarn relaxes and draws back into the needles to begin again. Choose the yarn (cream, crimson, teal, mustard or charcoal), the number of rows, how many cables, how fuzzy the wool looks, the seed, the backdrop and whether the camera drifts.",
  "role": "Object (3D, three.js): a cosy, tactile hero object for craft, winter, fashion and handmade content.",
  "collections": [
    "satisfying",
    "hypnotic-loops",
    "product-reveals"
  ],
  "tags": [
    "knitting",
    "cable knit",
    "wool",
    "yarn",
    "craft",
    "needles",
    "stitches",
    "cosy",
    "handmade",
    "loop",
    "3d"
  ],
  "synonyms": [
    "knitted fabric",
    "wool knit",
    "aran knit",
    "knitting animation",
    "cable stitch",
    "yarn loops"
  ],
  "useCases": [
    "A craft, fashion or winter-collection title scene",
    "A cosy handmade-brand backdrop",
    "A \"building up row by row\" progress metaphor"
  ],
  "featured": null,
  "publishedAt": "2026-10-05",
  "implementation": {
    "target": "three",
    "runtime": "browser",
    "language": "javascript",
    "module": "esm",
    "entry": "src/cable-knit.js",
    "exports": [
      {
        "name": "createCableKnit",
        "signature": "createCableKnit({ yarn?, rows?, cables?, fuzz?, seed? }) => { group, setProgress(progress), dispose() }",
        "description": "The fabric (one instanced mesh of stitches) and two needles as a group, hanging down from y = 0; add it with an environment map and a shadow-casting light."
      },
      {
        "name": "YARNS",
        "signature": "YARNS: { cream, crimson, teal, mustard, charcoal }",
        "description": "Yarn colours."
      }
    ],
    "reusable": [
      "src/cable-knit.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": "yarn",
      "label": "Yarn",
      "type": "select",
      "default": "cream",
      "options": [
        {
          "value": "cream",
          "label": "Cream"
        },
        {
          "value": "crimson",
          "label": "Crimson"
        },
        {
          "value": "teal",
          "label": "Teal"
        },
        {
          "value": "mustard",
          "label": "Mustard"
        },
        {
          "value": "charcoal",
          "label": "Charcoal"
        }
      ]
    },
    {
      "key": "rows",
      "label": "Rows",
      "type": "integer",
      "min": 14,
      "max": 40,
      "step": 1,
      "default": 26
    },
    {
      "key": "cables",
      "label": "Cables",
      "help": "Braided cables in the middle (0 for plain knitting).",
      "type": "integer",
      "min": 0,
      "max": 2,
      "step": 1,
      "default": 1
    },
    {
      "key": "fuzz",
      "label": "Fuzz",
      "type": "number",
      "min": 0,
      "max": 1.5,
      "step": 0.05,
      "default": 1
    },
    {
      "key": "seed",
      "label": "Seed",
      "type": "integer",
      "min": 1,
      "max": 999,
      "step": 1,
      "default": 4
    },
    {
      "key": "background",
      "label": "Backdrop",
      "type": "color",
      "default": "#3a3028"
    },
    {
      "key": "orbit",
      "label": "Camera drift",
      "type": "boolean",
      "default": true
    }
  ],
  "presets": [
    {
      "id": "default",
      "label": "Cream, one cable",
      "params": {}
    },
    {
      "id": "crimson",
      "label": "Crimson, two cables",
      "params": {
        "yarn": "crimson",
        "cables": 2,
        "background": "#2a1c20"
      }
    },
    {
      "id": "teal",
      "label": "Teal, plain knit",
      "params": {
        "yarn": "teal",
        "cables": 0,
        "rows": 32,
        "background": "#1c2a30"
      }
    },
    {
      "id": "mustard",
      "label": "Mustard, short",
      "params": {
        "yarn": "mustard",
        "rows": 18,
        "seed": 9,
        "background": "#2c2a22"
      }
    }
  ],
  "output": {
    "width": 1080,
    "height": 1080,
    "fps": 30,
    "durationSeconds": 16,
    "posterSeconds": 12,
    "alpha": false,
    "motion": "procedural",
    "loop": {
      "seamless": true,
      "cycleSeconds": 16,
      "method": "Each stitch appears at a fixed share of the loop (row by row, left to right) and the whole piece relaxes back into the needles before the end, so the first and last frames are identical; the needles' clicking is a sine of a whole number of cycles."
    },
    "seed": {
      "param": "seed",
      "behavior": "Seed varies each stitch's colour shade, jitter and twist: same seed, same piece."
    }
  },
  "composition": {
    "inputs": "Time within the loop; the yarn, rows, cables, fuzz, seed, backdrop and camera drift.",
    "outputs": "A full frame rendered in 3D with soft shadows and a studio environment.",
    "coordinates": "The fabric hangs from the needles at y = 0 down to about -9, 16 stitches (7 wide); the demo lifts it 8.6 above the floor.",
    "lighting": "A warm key light with a shadow map, the studio environment and sheen on the wool.",
    "timing": "setProgress(progress) sets every stitch's growth and the needles; frames render in any order.",
    "compatibleWith": [
      "chrome-material",
      "orbit-camera",
      "kinetic-title",
      "number-reveal"
    ],
    "notes": [
      "A stitch is a tube bent into a V with a loop at its foot; 16 columns by up to 40 rows are one instanced mesh with per-stitch colour; the cables swap four columns over each other by a smooth shift every twelve rows."
    ]
  },
  "reuse": [
    "Winter-collection title: Cream, one cable.",
    "Warm brand scene: Crimson, two cables.",
    "Calm craft loop: Teal, plain knit."
  ],
  "integration": {
    "newProject": "Create a WebGLRenderer with shadows and a studio environment (see chrome-material), add createCableKnit().group and call knit.setProgress(progress) each frame.",
    "existingProject": "Copy src/cable-knit.js; add knit.group to your scene with an environment map and a shadow-casting light."
  },
  "performance": {
    "notes": "One instanced mesh of up to 640 tube stitches (about 800 triangles each) and two needles, one shadow map. A few milliseconds a frame on an integrated Intel GPU.",
    "limits": "Software WebGL renders in a second or two a frame."
  },
  "limitations": [
    "The stitches grow in place rather than being pulled through by the needles; the needles do not touch the yarn.",
    "The cables are a smooth column swap, not real crossing yarn."
  ],
  "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/objects-scenes/cable-knit (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original object: V-shaped tube stitches on an instanced grid, a column-swapping cable, a row-by-row growth schedule and relaxing return for an exact loop.",
  "changelog": [
    {
      "version": "1.0.0",
      "date": "2026-10-05",
      "notes": "Initial release."
    }
  ]
}
