TL;DR
Generating 3D digital art is one thing, but turning a 3D shape into a real-world LEGO® model that doesn't immediately collapse under gravity is a much harder puzzle. BrickAnything solves this by treating brick assembly not as a grid of coordinates, but as a tree of physical, local attachments conditioned on 3D point clouds. By combining this intuitive representation with preference-based post-training and smart error-correction, the model reliably turns complex 3D shapes into faithful, physically buildable brick structures—even when traditional algorithms fail completely.
What Problem Does This Paper Address?
Imagine trying to build a statue out of standard LEGO® bricks. Unlike digital meshes or point clouds where vertices can float freely in continuous space, bricks live in a strict, unforgiving world of discrete stud alignments, limited part sizes, and gravity. One poorly placed brick, and the whole cantilevered arm snaps off.
Existing automated approaches fall into two camps, each with a catch. Search-based heuristics (like Legolization) treat assembly as a combinatorial optimization puzzle. They guarantee physical stability when they work, but they are rigid: if an input 3D shape can’t be cleanly realized within strict, predefined voxel rules, the search simply breaks down and fails. Conversely, recent generative AI models (like BrickGPT) predict brick placements step-by-step like words in a sentence. However, they usually rely on text prompts or 2D images—meaning they lack explicit 3D spatial boundaries—and serialize bricks by global $(x,y,z)$ coordinates rather than how bricks actually click together. BrickAnything bridges this gap: how do we build a flexible generative model that respects explicit 3D geometry and physical assembly laws?
Methods
BrickAnything is an autoregressive framework (built on an OPT-350M transformer) that constructs models inside a $20 \times 20 \times 20$ grid using eight standard brick sizes. To accept any 3D format (meshes, Gaussian splats, RGB-D), it first converts the input into a unified 8,192-point cloud with surface normals, encoding it via a pre-trained Michelangelo shape encoder.
While point-cloud conditioning and transformer backbones are standard, the authors introduce three clever innovations tailored to physical assembly:
- Structure-Aware Tree Tokenization: Instead of sorting bricks globally from bottom-to-top, left-to-right, the authors represent the assembly as a vertical connectivity graph traversed via Breadth-First Search (BFS). Only the root brick gets absolute $(x, y, z)$ coordinates. Every subsequent "child" brick is encoded relativistically to its parent: which stud on the parent it attaches to ($f$), its own dimensions ($h, w$), and which anchor on the child clicks in ($m$).
- Buildability-Aware DPO: Standard next-token prediction doesn't inherently understand gravity or overall shape similarity. In post-training, the authors generate candidate assemblies and score them using a custom reward combining volumetric overlap (Voxel IoU), surface alignment (Chamfer Distance), and static frictional equilibrium (minimum per-brick stability via StableLego). They then fine-tune the model using Direct Preference Optimization (DPO) weighted by the reward gap between good and bad builds.
- Validity-Constrained Decoding & Parent-Aware Rollback: During inference, the model rejects invalid part sizes or colliding bricks on the fly. Once a build finishes, a global physics check runs. If brick $k$ is unstable, the model doesn't just erase the last few tokens—it traces the tree back to $k$'s parent brick, rolls the sequence back to before that parent was placed, and regenerates the faulty branch.
Datasets
The authors curated roughly 230K high-quality 3D meshes from ShapeNet, Objaverse, and Objaverse-XL. Running the heuristic Legolization algorithm on these yielded ~168K stable mesh–brick pairs (164K for training, 4K for validation).
For evaluation, they created two distinct 500-mesh benchmarks:
- Stable Subset: Validation shapes where Legolization succeeded.
- Challenging Subset: Difficult geometries sampled specifically from the ~62K cases where Legolization failed to find a stable build.
Key Insights and Ideas
- Think locally, build globally: Changing how you serialize a 3D structure changes what the transformer learns. By predicting local stud attachments rather than global coordinates, every generated token inherently guarantees connectivity, dramatically shrinking the space of invalid intermediate states.
- Tree structures make surgical error-correction possible: In a standard flat coordinate sequence, fixing an unstable brick on layer 5 might require wiping out dozens of perfectly stable, unrelated bricks generated in between. Because BrickAnything knows the parent-child tree, rolling back targets only the structural root of the instability.
- Generative priors rescue brittle heuristics: When a target 3D mesh has thin or awkward geometry that violates strict voxelization rules, search heuristics hit a wall. A geometry-conditioned generative model, nudged by DPO, learns to gracefully approximate the shape so it remains physically buildable.
Key Results
On the Challenging Subset, where the heuristic Legolization baseline achieves 0.0% stability, BrickAnything generates physically stable structures 83.4% of the time (and 100% collision-free valid placements). Compared to a baseline using conventional BrickGPT-style coordinate tokenization with DPO, BrickAnything boosts stability from 76.0% to 83.4%, improves Voxel IoU from 0.553 to 0.586, and slashes the average number of inference rollbacks by over 15x—from 6.750 down to 0.422.
On the Stable Subset, Legolization naturally gets perfect IoU (1.000) since the ground-truth data came from its successes. However, among learned models, BrickAnything leads across the board: achieving 100% stability, improving IoU over the coordinate-ordered baseline (0.788 vs. 0.742), and dropping average rollbacks from 3.620 to a mere 0.184.
Limitations and Future Work
While the authors defer their formal discussion of limitations and future work to Appendix E (which is not included in the main paper text), several scope boundaries are apparent from their setup: the current system is restricted to a relatively coarse $20 \times 20 \times 20$ voxel grid and a vocabulary of only eight basic rectangular LEGO® bricks, leaving higher resolutions and specialized, non-rectangular part geometries for future exploration.
Summary updated