The question
I came across a site that turns a picture into a Lego model and assembles it in 3D. The part I loved was the scrubbing: drag back and the model comes apart, drag forward and it builds again. I wanted to make my own version with Claude, as a lab experiment rather than a full app.
One rule kept it honest: every piece is a single standard part you could order on its own. If it's in the model, it has a part number.
How it works
Simplify the photo
Each subject is reduced to a few clean shapes. Lego can't do fur or reflections, so the first job is deciding what to keep.
Turn it into a 3D grid
The shapes become a block of tiny cubes, one per stud, each with a colour.
Pack it with real parts
Neighbouring cubes of the same colour merge into the largest bricks and plates that fit. Anything the pieces below can't hold is removed or recoloured, so the model stays in one piece.
Order it bottom-up
Pieces are sequenced from the base upward, spiralling round the model, in steps of four.
Tie it to the scroll
Each piece drops in as your scroll reaches it. Scroll up and the drops play in reverse.
Each build below has its own scroll section. Scroll through to build it, use the slider to jump, or drag the model to turn it. Open the parts list to see exactly what you'd need to buy.
Example 1
The simplest shape, and a good test of the packing: a hollow shell with a curved neck, a red label band and a red cap. The label carries a short word in pixel lettering. It's generic rather than a real brand, which is why it doesn't match the logo in the photo.
Cola bottle · 731 pieces · press play to build, drag to turn
Example 2
My first version was a flat relief wall, which missed the point. This one is a true 3D mountain: a stepped cone with a snow cap and pink and purple shading, standing behind a lake. The reflection is laid out in flat plates in front, mirroring the outline.
Mount Fuji · 574 pieces · press play to build, drag to turn
Example 3
The hardest of the three, because everything is curved. The body, head, beak and feet are smooth shapes snapped to the stud grid. The eye is a single black stud, and the wing is a colour patch rather than a separate piece.
Duckling · 354 pieces · press play to build, drag to turn
Reflections
The scrubbing was the easy part
Once each piece's motion was tied to the scroll position, it just worked.
Curves leave loose pieces
Curved shapes leave small pieces floating free, and each needed a rule to rejoin, recolour or drop it. The duckling still loses about a dozen single studs I couldn't anchor.
Start simpler
The more complex the photo, the harder the build. These were too complicated for a first iteration.
Looking, not code
Claude couldn't tell that the duck's eye sat too low or that Fuji looked like a wall. I had to point and say so. After that the fixes were quick.
These three are pre-made. Letting people upload their own photo would need the simplify step to be automatic, which is what I'd tackle next. The parts lists are just lists, with no shop links.