anteloc/ldraw-nova
Sobre
Ferramentas para agentes construírem modelos LEGO generativos, desenvolvidas com Astra e Opus 5.5 e potencializadas por Jev.
IA e aprendizado de máquinaCrescimento medido de estrelas
- em 24 h
- +1
- em 7 dias
- +15
- em 15 dias
- +24
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Originalldraw-nova
Give an AI agent a model idea. Guide it, let it build it, and get an LDraw LEGO© model.
What you get when the building process finishes:
Metrics: total generation time and timing for each stage, including planning, tool execution and agent/model thinking time where exposed by the runtime. Unavailable measurements are identified explicitly.
Visual evidence: every xray board's
xray/<board>/mosaic.png, plus stills and previews from different perspectives.LDraw model:
ai-NAME.mpd, named after the model with theai-prefix (e.g.ai-ford-mustang.mpd), with[AI-GENERATED]prefixed to its internal main-model title, contributing agent/model names and versions, and0 !KEYWORDS AI, AI-generatedin the generated sections' headers. Each generated section includes these consecutive lines:0 !LICENSE CC-BY-NC 0 Allows sharing and adapting for noncommercial purposes only, with attribution to the AI that authored the current model.
These are the mandatory deliverables for each model. Additional exports or files, such as .blend, .glb or videos, are produced only when requested. Plans, generators and tool reports remain internal working files. See the delivery requirements.
Take a look at the video:
Installation
For local CLI and agent use, run ./setup.sh; see local setup
for project-local tools, the official LDraw library and environment variables.
Agent guides cover xray inspection and
model annotation.
Browse local annotated models with ./model-selector.sh after setup: search,
preview in 3D, and copy a construction-reference prompt. See the
model selector guide.
Agents start from documented construction guidance and examples. For specific
part questions, the part-information guide
explains SQL, regex, FTS, Jev, category and cached-dimension searches. These tools
support the construction workflow; agents must not read library .dat source
directly or recreate established techniques piece by piece.
The Docker web app setup follows below.
[!IMPORTANT] Tools used by agents in order to find suitable parts and example models take advantage of jev-rerank (I'm also the author). This is a semantic search tool with 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 search will not work, and agents will resort to a FTS (Full Text Search) strategy as a fallback, which could (maybe) yield worse models.
Run ldraw-nova as a web app, with Docker. You need Git and Docker.
This web app will run dockerized, and to build the Docker image, two sibling repos are required:
ldraw-nova: this one, of course 😉ldraw-nova-docker: provides both Docker configuration and the web app.
1. Clone both repos side by side, at the same tag, so they work together:
git clone --branch v0.6.0 https://github.com/anteloc/ldraw-nova.git
git clone --branch v0.6.0 https://github.com/anteloc/ldraw-nova-docker.git
2. Build the Docker image. The first build takes a while and needs about 5 GB of disk space:
cd ldraw-nova-docker
docker compose build
3. Start the app:
docker compose up -d
4. Open it in your browser:
- https://localhost:8443: needed for VR on Meta Quest 3. The certificate is self-signed, so accept the browser's warning the first time.
- http://localhost:8765: plain HTTP, no certificate warnings. Use it if the self-signed certificate gets in the way. VR won't work over it.
Other devices on your network can reach the app by your computer's IP instead of localhost, e.g. https://192.168.1.20:8443 from a Quest 3. The app has no login, so only run it on networks you trust.
To stop it:
docker compose down
Why all of this?
Well, to summarize: I did this in order to get agentic LLMs capable of designing buildable, physical things!
Finding LDraw, an assembly language (pun intended! 😜) that would be at the same time simple, low level, and executable in order to produce 3D CAD models, gave me the idea of experimenting with both ChatGPT and Claude in order to try and make them code in LDraw, same as they do with other programming languages.
To my surprise, even though this language is heavily focused on math (parts rotations, positioning...), which LLMs are usually bad at, agents did pretty well instead on initial tests, and subsequent projects also yielded good results, but never enough in order to consider generated models to be correct:
- Initial research: ldbuilder-ai
- 1st attempt at an agentic python tooling: py2bricks
- 2nd attempt: py4bricks
These three attempts, and quite some other experimentation, led me to the following conclusions:
💡 Conclusion 1: there is a minimum resistance path to geometry math for agents, i.e.:
- Giving the agents tooling to generate LDraw sources would sidestep (evil!) geometry math
- ... because they do way better at generating python code that produces math
- ... than on producing math themselves!
💡 Conclusion 2:
- Agents tend to do better when learning from python code that produces models
- ... than from models themselves (LDraw's evil geometry, again...)
Then, the only thing left 🤔 was to create a python-based tooling with the required primitives, verbs, constructive vocabulary... so agents would learn by example and do similar things on their own.
Which proved to be really hard to get right, even if vibe coding it... until GPT-6 Astra and Claude Opus 5.5 arrived... and vibe-coded it right! 🚀🚀🚀
How it works
ldraw-nova provides the tools, examples and instructions an agent needs to design models with real LDraw parts.
The process is as follows:
- The agent takes a prompt.
- Reads instructions.md and related documents to LDraw language and LEGO© models building.
- Retrieves construction guidance and examples, adapts their principles, and plans the structure, submodels and appearance. Part-information searches resolve specific details as needed.
- Iteratively:
- Renders images from the model/submodel(s)
- Inspects them, adjusts positioning, aesthetics... and back to rendering
- ... until it considers the model finished and ready to deliver!
Provided tooling helps the agent in:
- Finding suitable parts.
- Also, example models and submodels to start with.
- Collision and gaps detection for placing parts correctly.
- Headless rendering for inspecting current results.
- and more...
The agent starts from construction guidance and examples, then authors an editable JSON plan using the existing tooling. For example, Copper Lane includes its plan, optional Python generator, and resulting MPD. Python can help author plans when needed; a new generator is not required for each model.
flowchart TD
brief[Brief] --> knowledge[Construction guidance and examples]
knowledge --> plan[Adapt principles into a JSON plan]
plan --> build[Existing build tooling]
build --> model[LDraw model]
model --> review[Inspect and repair]
review --> plan
Agent's informational sources
These are some of the guides and references given to the agent in order to make it a builder:
| I want to… | Read… |
|---|---|
| Ask an agent to generate a model | Agent instructions |
| Improve shape, colour and detail | Visual design guide |
| Build vehicles | Vehicle workflow and examples |
| Build advanced spaceships | Spaceship workflow and atlas |
| Learn a submodel and grow an atlas | Build-manual workflow |
| Build Technic structures | Structural workflow and examples |
| Build with mechanisms | Mechanism workflow and build manuals |
| Answer a specific part question | Part information: SQL, regex, FTS, Jev, categories and dimensions |
| Find reusable constructions | Reference discovery and reference atlas |
| Organize a large model | Module workflow and Copper Lane example |
| Understand connections and checks | Geometry, snapping and validation |
| Look up a command or file-format rule | Tool reference and LDraw rules |
Development
Being this a first release, there are quite some things that still require some work:
- VR on Meta Quest 3: model handling has many issues, performance issues.
- Adapt for low-end agents: adapt current tooling, docs and instructions in order to improve usage by low-end models like e.g. Luna, Haiku, etc.
- Expensive generation: currently, only expensive, high-end models, are currently capable of generating large-sized and correct models.
- Improve efficiency: generative process is currently slow.
- Add and improve more model families:
- Humans and animals: minifigs
- Technic models: machines, engines...
- Spaceships: generated models are not very good
- Building models from manuals: it partially works, better if page manuals are given as images.
- Fine-grained inspection: for inspecting submodels and their step-by-step building processes.
Contributing
COMING SOON
Acknowledgements
I'd like to thank 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 thanks to all of the many other 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, even for decades, by generously donating their finest work to the public domain and open source community.
If you think you should be included on this section, please drop me an email!
Trademarks
LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.
Explore projetos relacionados
Carregando…