Brick Build 3D

Category: Bricks

Live preview

    Equation-driven toy-brick 3D model that assembles itself stud by stud, drawn in real brick proportions (8 mm pitch, 9.6 mm brick) with dependency-free WebGL — key-light shadows cast between parts, glossy plastic shading and an outline on every part edge, like an instruction-booklet render — and a canvas-2D fallback where WebGL is unavailable. Two kinds of model. Toy bricks (bricks or shape) are procedural boxes with studs, from a named shape (heart, sphere, torus, helix, pyramid, house) or an explicit bricks array. Real parts (partsModel) are baked geometry from the LDraw.org Parts Library, under CC BY. Every design is checked by deterministic geometry — collisions, every brick anchored through stud connections (real parts also through pins, hinges, axles and clips), connection count, centre of mass over the footprint — and the verdicts show beside the model. An instructions mode steps through the build layer by layer, and a parts list groups bricks by size and colour with an indicative cost. Known limit, each brick canvas holds two WebGL contexts and a page allows about 16, so keep to about 7 brick canvases per page. Not affiliated with or endorsed by the LEGO Group. LEGO is a trademark of the LEGO Group.

    Surfaces
    google-apps-script-webwebmcp-appsandroid
    Fields
    FieldTypeRequired
    shapestring. One of "heart", "sphere", "torus", "helix", "pyramid", "house". Default "heart". Ignored when bricks is set.optional
    bricksarray. Explicit model — objects {x, y, z, w, d, h, c}. x and z are stud positions, y is the layer (0 sits on the baseplate), w and d the footprint in studs, h the height in bricks (default 1), c a '#rrggbb' colour or a palette index. A brick may also be a compact array [x, y, z, w, d, c] or [x, y, z, w, d, h, c], about a third of the size. Up to 3000 bricks. A data-model binding such as {path '/bricks'} arrives resolved.optional
    palettearray of "#rrggbb". Up to 256 colours. A brick's c may be an integer index into it, which keeps large models small.optional
    modestring. One of "animate", "steps". Default "animate".optional
    stepinteger. Initial instruction step when mode is steps. Default 1.optional
    speednumber. Animation speed multiplier. Default 1.optional
    orbitboolean. Slow auto-orbit; dragging always orbits. Default true.optional
    heightinteger. Canvas height px, 160 to 900. Default 380.optional
    bgstring. Canvas background colour. Transparent on the studio gradient by default.optional
    scrubberboolean. Show the animate/instructions toggle and step slider. Default true.optional
    checksboolean. Show the build-check verdicts. Default true.optional
    partsboolean. Show the parts list with an indicative cost. Default false.optional
    modelsarray. Named models for the picker dropdown — up to 8 objects {name, bricks, palette}, each bricks array as above (up to 3000 bricks each; palette optional, else the top-level one). Entries with no usable bricks are skipped; a missing name becomes Model N. The dropdown lists the six built-in shapes followed by these.optional
    modelstring. Name of the entry in models to show first. Ignored when bricks is set.optional
    pickerboolean. Show the model dropdown. Default true when models is given, otherwise false; set true to get a dropdown of the six built-in shapes alone.optional
    partsModelarray. Real parts from the LDraw.org Parts Library (CC BY) instead of procedural boxes, as [partId, x, y, z, rotation, colour] tuples (a real LDraw part id, x y z in LDraw units (20 per stud, 24 per brick height), a 0-23 rotation index, an LDraw colour code), or objects {p, x, y, z, r, c}. Takes precedence over bricks/shape when present, same "explicit wins" rule as bricks vs. shape. Up to 3000 parts.optional
    lookstring. One of "studio", "instructions". Default "instructions". instructions: the original building-instructions style (glossy plastic, dark outline on every part edge). studio: a product-shot style — no outlines, edges catch light instead (same visual treatment as the sibling motion_bricks atom, default there).optional
    basestring. "none" for floating bricks (no plate, no plate shadow), or a "#rrggbb" colour for the baseplate. Default the classic green plate.optional
    Example payload
    {
      "type": "brick_build_3d"
    }
    ARD catalog entry
    {
      "identifier": "urn:air:a2uicatalog.ai:atom:brick_build_3d",
      "displayName": "Brick Build 3D",
      "type": "application/vnd.a2ui.atom+json",
      "url": "https://a2uicatalog.ai/atoms/brick_build_3d/",
      "capabilities": [
        "google-apps-script-web",
        "web",
        "mcp-apps",
        "android"
      ],
      "description": "Equation-driven toy-brick 3D model that assembles itself stud by stud, drawn in real brick proportions (8 mm pitch, 9.6 mm brick) with dependency-free WebGL \u2014 key-light shadows cast between parts, glossy plastic shading and an outline on every part edge, like an instruction-booklet render \u2014 and a canvas-2D fallback where WebGL is unavailable. Two kinds of model. Toy bricks (bricks or shape) are procedural boxes with studs, from a named shape (heart, sphere, torus, helix, pyramid, house) or an explicit bricks array. Real parts (partsModel) are baked geometry from the LDraw.org Parts Library, under CC BY. Every design is checked by deterministic geometry \u2014 collisions, every brick anchored through stud connections (real parts also through pins, hinges, axles and clips), connection count, centre of mass over the footprint \u2014 and the verdicts show beside the model. An instructions mode steps through the build layer by layer, and a parts list groups bricks by size and colour with an indicative cost. Known limit, each brick canvas holds two WebGL contexts and a page allows about 16, so keep to about 7 brick canvases per page. Not affiliated with or endorsed by the LEGO Group. LEGO is a trademark of the LEGO Group.",
      "representativeQueries": [
        "show a self-assembling 3D brick model, toy bricks or real LDraw parts, with build checks, build steps and a parts list",
        "equation-driven toy-brick 3d model that assembles itself stud by stud, drawn in real brick proportio",
        "render a brick build 3d"
      ]
    }
    ← Full ARD catalog
    Deploy your own Google Apps Script renderer

    The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

    git clone https://github.com/a2uicatalog/a2ui
    cd a2ui/apps-script-surface/gas-wired-renderer
    clasp push && clasp deploy
    Full deploy guide →