Agent tooling for generative LEGO models building, built with Astra and Opus 5.5, powered by Jev - anteloc/ldraw-nova

74 points•antelocnova•about 7 hours ago•41 comments•
Hi there :-) New on HN, first time posting.

Past year, around December, I started experimenting with making ChatGPT and Claude generate source code in LDraw language.

This LDraw is literally an "assembly" language, a low-level programming language that describes how to assemble LEGO pieces together into models, one placement instruction at a time.

When executed by specific tools, like e.g. LDView, LeoCAD, Studio... these instructions become LEGO CAD models, that can be interacted with, modified, etc.

Or, in other words: one LDraw source file in .mpd or .ldr format is equivalent to one LEGO CAD model.

So, the idea I had was: if I manage for maybe ChatGPT or Claude to generate high-quality LDraw source files... then, they would actually be generating high-quality LEGO CAD models, right?

Then, after months of iterations and trying one thing after the other... it worked!!!

Long story short: using GPT-6 Astra and Opus 5.5, I've managed to create a python toolset, instructions, and docs for agents in general. Now, these can be used by them to generate LDraw models.

I've packed it all as a dockerized web app for others to try and experiment, with several providers (and agents) to choose from: OpenAI, Claude and OpenRouter.

Here's a bunch of exmaples: https://anteloc.github.io/index-samples.html.

If you are curious about the internals of an .mpd model, the "what was the agent picturing on its mind", open the .mpd file that got your attention on a text editor, and read the first line under the ones starting with "0 FILE".

I'd really appreciate feedback and comments, let's see where this goes =)

41 comments

dchukabout 4 hours ago
Not the same but adjacent hobby, I’ve had good success with feeding 3mf files to Claude (usually just fable in desktop app) that I found on maker world to prompt for modifications to the model and it works damn well. Stuff like changing a functional model from press fit only to using inset m bolts and nuts. Way better than doing it by hand in a cad app
antelocnovaabout 2 hours ago
A very similar idea crossed my mind several times, but with a twist: altering LEGO CAD parts, but keeping the connectors the same.

Main idea was, if LEGO parts don't cover the needs for an agent to build a model, let it use the best it can find, and manufacture others if needed, but keeping same compatibility with the rest of the catalog.

And for that, instead of generating new parts from scratch, maybe mutating pre-existing parts into new shapes it needs, but leaving connectors as they were, or even adding new connectors but still compatible.

vunderbaabout 7 hours ago
Nice job. I actually read a paper on Arxiv last year about this exact thing - using LLMs to drive model building through LDraw that might be worth reading [1].

They had some interesting experiments like giving the LLM a fixed set of parts as a constraint and asked it to "build" tools out of those available lego.

I think they were using Opus 4.5 so I'm sure with even more powerful models it'll be even better.

[1] - https://arxiv.org/pdf/2512.15743

antelocnovaabout 6 hours ago
Hi there, thanks!

I'm taking a look at this paper right now, didn't came across it before.

I think it's really good, and also an approach I tried.

In my case, it was working pretty well in terms of geometry and correctness, but not in terms of creativity: too many constraints and an agentic LLM would end up building very similar buildings all the time. Too few ones, and it would drift into unbuildable models.

In the end, I think the current iterative process gives it a good balance: let it try things first and be creative, parts will be placed incorrectly at the beginning, but it will fix their placements, colours and so on bit by bit, until the end result is (hopefully!) correct.

And regarding Opus, according to my experience, I'd say definitely models quality is way better when produced by Opus 5 and even better by Opus 5.5

jasonhongabout 3 hours ago
You might also be interested in this research at CMU:

https://avalovelace1.github.io/BrickGPT/

We introduce BrickGPT, the first approach for generating physically stable toy brick models from text prompts. To achieve this, we construct a large-scale, physically stable dataset of brick designs, along with their associated captions, and train an autoregressive large language model to predict the next brick to add via next-token prediction. To improve the stability of the resulting designs, we employ an efficient validity check and physics-aware rollback during autoregressive inference, which prunes infeasible token predictions using physics laws and assembly constraints. Our experiments show that BrickGPT produces stable, diverse, and aesthetically pleasing brick designs that align closely with the input text prompts. We also develop a text-based brick texturing method to generate colored and textured designs. We show that our designs can be assembled manually by humans and automatically by robotic arms. We also release our new dataset, StableText2Brick, containing over 47,000 brick structures of over 28,000 unique 3D objects accompanied by detailed captions, along with our code and models.

ash_091about 6 hours ago
Neat! Perhaps I'll finally get around to doing something with the 51515 Lego set I have laying around collecting dust.

> I did this in order to get agentic LLMs capable of designing buildable, physical things!

I've been experimenting with FreeCAD + freecad-mcp + Claude recently and have been similarly surprised how well this works. I've produced three useful parts from Claude's designs: a 3d printed case for an OLED display + some inputs + an ESP32, and a milled aluminium hotend mount adapter for a 3d printer, and a printed pen + pressure sensor mount to use the printer as a plotter. I just provided part/model numbers plus a couple of caliper measurements Claude wasn't able to find online and went through two or three cad revisions before making the parts. All three worked on the first hardware revision.

The biggest thing I've found it seems to struggle with is understanding how the parts will be assembled. The pen mount in particular was tricky to put together, having a part which needed to fit through a slightly too small space to get to its spot. Although it's hard to blame the AI for that when I didn't notice it either I suppose.

antelocnovaabout 6 hours ago
Thanks!

I've been experimenting with FreeCAD and freecad-mcp too, even managed for Claude to create a new LDraw benchmark for it.

However, given the amount of parts some LDraw models have, FreeCAD performance would not be enough, something to do with its solver trying to work out too many constraints at once.

The thing about how to assemble the parts, yes, that drove me crazy for quite a while.

A way I found that helps is to provide the agents information about contacts, e.g. what parts of a brick are actually connectors.

With that in place, it can create tools to automatically check if two parts are connected "the right way" ;-)

I got LEGO connectors info from here: https://www.melkert.net/LDCad/tech/shadowLib

ash_091about 6 hours ago
I just added another comment under my original as you were replying- I'll try not to spam you with too many questions, this is just so cool though!

Do you find the models generally manage to avoid making errors when placing parts (e.g. placing parts which intersect, don't connect properly, etc) or do they rely on validation and correction cycles?

nicoabout 6 hours ago
> I've been experimenting with FreeCAD + freecad-mcp + Claude recently and have been similarly surprised how well this works

Yup. I’ve been getting some pretty decent 3d models directly on stl format + the slicer file with all the right configs for my printer

It’s cool to create a simulation, run some visualizations on web directly from Claude desktop, and then choosing a model to print and build

I also added some genetic algorithms to make it fun iterating on different shapes/mechanisms

I really enjoy how much creativity these tools are unlocking by enabling bridging so many elements together

ash_091about 6 hours ago
> the 51515 Lego set

On that note- have you considered adding constraints for part availability? It would be useful to be able to create designs using only parts which are on hand.

I recall seeing a project a while ago which could take a photo of a pile of lego as input and produce models that could be made with those parts. Although I think in that case the models were sorta just random arrangements.

dyabout 7 hours ago
Thanks for sharing - I'm actually working with my kid on something similar but with physics modeling for First Lego League. Cool to see your approach!
antelocnovaabout 4 hours ago
Physics modeling is something Nova is currently lacking, and I think very interesting, given that agents currently don't verify physics, stability... only placements.
ttulabout 6 hours ago
Up next: a tool that converts a photograph of your dumped bin of old Lego into a catalogue of all the Lego in your collection..
ash_091about 6 hours ago
pj_mukhabout 5 hours ago
ugh, want this so bad.

I bought so many sets, and I want to rebuild them, but they're a whole big mess. I want to sort them out.

Makes finding pieces for new builds much easier too

Read the full thread on Hacker News →

Related stories