DEV Community

Cover image for I let an AI design LEGO-style models, then wrote code that decides whether they're allowed to exist
Zhang Liu (刘章)
Zhang Liu (刘章)

Posted on

I let an AI design LEGO-style models, then wrote code that decides whether they're allowed to exist

I'm one person with four iOS apps released in September. This is about the one I found hardest to get right: Brickium.

The idea: you list the bricks you already own, say what you want ("a small car with four wheels"), and the app designs a model from only those parts, then shows step-by-step 3D instructions.

The problem: an AI that proposes a model will sometimes propose one that can't be built. A part you don't have, two bricks in the same space, a piece floating in the air.

So the AI only proposes. A separate, non-AI checker then verifies three things: every part is in your inventory, nothing overlaps, and every brick is supported and connected. If a design fails, you never see it and you aren't charged for it.

Things I learned:

  • Giving the model detailed repair hints helped a weaker model and hurt a stronger one. Error messages had to be tuned per model, not globally.
  • A deterministic check is boring and it is the only reason I can say a model will actually build.
  • The wait for a design is about 40 seconds. In the demo clip I cut that short; I'd rather say so.

Limits today: 29 basic part types in 20 colours, so models are small and blocky; the interface is English and Chinese; the app is for adults, kids can build along.

App Store: https://apps.apple.com/app/id6812500807
I'd like to hear what you tried to build that it couldn't do.

Top comments (0)