Category: Bricks
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.
| Field | Type | Required |
|---|---|---|
| shape | string. One of "heart", "sphere", "torus", "helix", "pyramid", "house". Default "heart". Ignored when bricks is set. | optional |
| bricks | array. 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 |
| palette | array of "#rrggbb". Up to 256 colours. A brick's c may be an integer index into it, which keeps large models small. | optional |
| mode | string. One of "animate", "steps". Default "animate". | optional |
| step | integer. Initial instruction step when mode is steps. Default 1. | optional |
| speed | number. Animation speed multiplier. Default 1. | optional |
| orbit | boolean. Slow auto-orbit; dragging always orbits. Default true. | optional |
| height | integer. Canvas height px, 160 to 900. Default 380. | optional |
| bg | string. Canvas background colour. Transparent on the studio gradient by default. | optional |
| scrubber | boolean. Show the animate/instructions toggle and step slider. Default true. | optional |
| checks | boolean. Show the build-check verdicts. Default true. | optional |
| parts | boolean. Show the parts list with an indicative cost. Default false. | optional |
| models | array. 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 |
| model | string. Name of the entry in models to show first. Ignored when bricks is set. | optional |
| picker | boolean. 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 |
| partsModel | array. 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 |
| look | string. 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 |
| base | string. "none" for floating bricks (no plate, no plate shadow), or a "#rrggbb" colour for the baseplate. Default the classic green plate. | optional |
{
"type": "brick_build_3d"
}
{
"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"
]
}
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 →