Give an AI delegate a example idea. Guide it, let it build it, and get an LDraw LEGO© model.
What you get whenever the construction procedure finishes:
- Its source code, in LDraw language.
- Different views: 3D viewer, 3D player, VR interactive (Meta Quest 3), images...
- Blender editable glTF file, in .glb format, metainfo as Blender's Custom Properties.
- Chat history and agent thinking process.
- and more... 👌
Take a appearance at the video:
Important
Tools used by agents in command to discover suitable parts and example models obtain advantage of jev-rerank (I'm additionally the author). This is a semantic hunt tool alongside re-ranking backed by TypeSafe's Jev System One AI model.
- If you have a TypeSafe API key (TYPESAFE_API_KEY), set its value on the web app's Settings section.
- If you don't, reranking hunt will not work, and agents volition retreat to a FTS (Full Text Search) scheme as a fallback, which could (maybe) output worse models.
Run ldraw-nova as a web app, alongside Docker. You need Git and Docker.
This web app volition run dockerized, and to build the Docker image, two brother or sister repos are required:
- ldraw-nova: this one, of way 😉
- ldraw-nova-docker: provides the two Docker configuration and the web app.
1. Clone the two repos flank by side, at the same tag, so they activity together:
git copy --branch v0.6.0 https://github.com/anteloc/ldraw-nova.git git copy --branch v0.6.0 https://github.com/anteloc/ldraw-nova-docker.git
2. Build the Docker image. The archetypal build takes a during and needs concerning 5 GB of disk space:
cd ldraw-nova-docker docker create build3. Start the app:
4. Open it in your browser:
- https://localhost:8443: needed for VR on Meta Quest 3. The certificate is self-signed, so obtain the browser's alert the archetypal time.
- http://localhost:8765: plain HTTP, no certificate warnings. Use it if the self-signed certificate gets in the way. VR won't activity complete it.
Other devices on your network can attain the app by your computer's IP alternatively of localhost, e.g. https://192.168.1.20:8443 from a Quest 3. The app has no login, so lone run it on networks you trust.
To halt it:
Well, to summarize: I did this in command to get agentic LLMs capable of designing buildable, bodily things!
Finding LDraw, an assembly language (pun intended! 😜) that would be at the identical period simple, low level, and executable in command to produce 3D CAD models, gave me the idea of experimenting alongside the two ChatGPT and Claude in command to try and create them code in LDraw, identical as they do alongside another programming languages.
To my surprise, equal although this tongue is heavily focused on math (parts rotations, positioning...), which LLMs are usually bad at, agents did beautiful well alternatively on first tests, and consequent projects additionally yielded good results, but never enough in command to regard generated models to be correct:
- Initial research: ldbuilder-ai
- 1st attempt at an agentic python tooling: py2bricks
- 2nd attempt: py4bricks
These three attempts, and fairly several another experimentation, led me to the following conclusions:
💡 Conclusion 1: there is a minimum opposition way to geometry math for agents, i.e.:
- Giving the agents tooling to create LDraw sources would sidestep (evil!) geometry math
- ... since they do way better at generating python code that produces math
- ... than on producing math themselves!
💡 Conclusion 2:
- Agents lean to do better whenever learning from python code that produces models
- ... than from models themselves (LDraw's evil geometry, again...)
Then, the only item remaining 🤔 was to create a python-based tooling alongside the required primitives, verbs, constructive vocabulary... so agents would learn by example and do akin things on their own.
Which proved to be really hard to get right, equal if vibe coding it... until GPT-6 Astra and Claude Opus 5.5 arrived... and vibe-coded it right! 🚀🚀🚀
ldraw-nova provides the tools, examples and instructions an delegate needs to scheme models alongside genuine LDraw parts.
The procedure is as follows:
- The delegate takes a prompt.
- Reads instructions.md and connected documents to LDraw language and LEGO© models building.
- Plans how to build the model: required parts, submodels to be created, aesthetics...
- Iteratively:
- Renders images from the model/submodel(s)
- Inspects them, adjusts positioning, aesthetics... and rear to rendering
- ... until it considers the model finished and prepared to deliver!
Provided tooling helps the delegate in:
- Finding suitable parts.
- Also, example models and submodels to commencement with.
- Collision and gaps detection for placing parts correctly.
- Headless rendering for inspecting current results.
- and more...
The delegate doesn't really commencement alongside placing parts, apart from for things akin e.g. prototyping and learning by altering pre-existing example models.
The way it produces models is additional like:
- Collects the required information, from experimental results, docs and planning.
- Builds one or additional plans, that completely depict the example and submodels, including its geometry, akin e.g. atlas-crane.plan.json
- And alongside that plan, it creates one or additional generator scripts akin e.g. generate.py
- ... that whenever executed, produce LDraw source file(s), a extremely specialized 3D CAD language.
- ... akin e.g. atlas-crane.mpd
To summarize, this is like:
- an agent creating a generator
- ... that produces a 3D model
- ... in an assembly language named LDraw 🤯
A compiler of sorts, so to say 🤓
flowchart TD agent([agent]) -- produces --> plan[plan.json] scheme -- explanation --> gen[generator.py] gen -- implementation --> model[model.mpd] These are several of the guides and references stated to the delegate in command to create it a builder:
Being this a first release, there are fairly several things that motionless necessitate several work:
- VR on Meta Quest 3: example handling has many issues, achievement issues.
- Adapt for low-end agents: modify current tooling, docs and instructions in command to enhance use by low-end models akin e.g. Luna, Haiku, etc.
- Expensive generation: currently, lone expensive, high-end models, are currently capable of generating large-sized and accurate models.
- Improve efficiency: generative procedure is currently slow.
- Add and improve additional model families:
- Humans and animals: minifigs
- Technic models: machines, engines...
- Spaceships: generated models are not extremely good
- Building models from manuals: it partially works, improved if leaf manuals are stated as images.
- Fine-grained inspection: for inspecting submodels and their step-by-step construction processes.
COMING SOON
I'd akin to appreciate the following:
- The LDraw Community
- LDView's Travis Cobbs (@tcobbs), and contributors.
- LeoCAD's Leonardo Zide (@leozide), and contributors.
- LDCad and Shadow Library, Roland Melkert.
- ldraw.rs's Park Joon-Kyu (@segfault87), and contributors.
- pyldraw3's Harold Martin (@hbmartin), and contributors.
... and gratitude to all of the many another LDraw creators!
NOTE: For this work, I've used many LDraw models, libraries, tools, docs... from many sources.
There is a lot amazing people that generously contributed to this, equal for decades, by generously donating their finest work to the community domain and open origin community.
If you think you have to be included on this section, delight drop me an email!
LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.