chaarlie130/BrickBlender

Neurosymbolic Generative AI for Physically-Valid 3D LEGO Architecture (Llama-3.2-3B + MLX + Three.js)

Python

0

134 commits

updated Sep 10, 2026

See the code

README

BrickBlender

A research project working toward locally trained generation of novel LEGO Architecture-style buildings on a 16 GB Mac mini M4.

Current status: novel, aesthetically pleasing, physically buildable generation has not yet been demonstrated. The strongest verified capability is exact retrieval and CAD reconstruction of existing designs. Codec round trips and source hashes establish data fidelity, not physical validity or creativity.

The active objective, experiment decisions, reproducible checks, and remaining requirements are maintained in docs/GOAL_STATUS.md.

What exists

  • LDraw/MPD/Studio ingestion, several experimental spatial codecs, and local MLX fine-tuning checkpoints.
  • Exact known-model retrieval with section-level integrity checks.
  • A Three.js viewer, LDraw export, and legacy inventory/pricing workflows.
  • A new physical-corpus audit that resolves inherited colors, flags unresolved inventory, separates flexible rendering geometry, and groups design families before splitting.

The older generation branches failed important reconstruction and free-running checks. Some historical reports counted procedural scaffold output as successful builds. Their provenance fields and experiment notes must be read before quoting metrics. The old curation filter checked duplicate origins; its stored stability_score values are not physical stability measurements.

Local use

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python scripts/serve_app.py --port 8080

Open http://localhost:8080 to inspect reference and catalog models. The existing application is not the acceptance test for the new generation objective. Model checkpoints, raw datasets, and LDraw libraries are local prerequisites and are not all distributed with this repository.

Active corpus audit

.venv/bin/python -m unittest scripts.test_physical_corpus
.venv/bin/python scripts/audit_physical_corpus.py

This uses the original 47 official and 198 legacy curated source records plus scratch/ldraw, the full local LDraw library. Output:

  • data/corpus_v2/audit.json: source provenance, inventory issues, family links, splits, and consulted library hashes.
  • data/corpus_v2/candidates.json: complete 40–600-piece parses awaiting construction and visual review.

The revised audit found 106 complete parses, including 96 size-band candidates spanning 65 conservatively grouped families. V2 fixes set-number title variants that separated related designs; V1 is retained for old experiment provenance. These candidate files have not all passed physical construction validation.

Current research direction

Start with pavilions and stepped towers, approximately 30 common part types, eight colors, upright connections, and an included physical base. Evaluate attachment-based generation against coordinate prediction before scaling local training. Measure complete builds against procedural and retrieval baselines.

The final evaluation must report every attempted generation, actual physical piece counts, supported construction checks, novelty, runtime, and memory. Aesthetic approval and real-world assembly require human evidence.

License

Project code is MIT licensed; see LICENSE. Third-party model files, part libraries, datasets, and dependencies retain their own licenses. LEGO is a trademark of the LEGO Group, which does not sponsor or endorse this project.

chaarlie130/BrickBlender

Neurosymbolic Generative AI for Physically-Valid 3D LEGO Architecture (Llama-3.2-3B + MLX + Three.js)

Python

0

134 commits

updated Sep 10, 2026

See the code

README

BrickBlender

A research project working toward locally trained generation of novel LEGO Architecture-style buildings on a 16 GB Mac mini M4.

Current status: novel, aesthetically pleasing, physically buildable generation has not yet been demonstrated. The strongest verified capability is exact retrieval and CAD reconstruction of existing designs. Codec round trips and source hashes establish data fidelity, not physical validity or creativity.

The active objective, experiment decisions, reproducible checks, and remaining requirements are maintained in docs/GOAL_STATUS.md.

What exists

  • LDraw/MPD/Studio ingestion, several experimental spatial codecs, and local MLX fine-tuning checkpoints.
  • Exact known-model retrieval with section-level integrity checks.
  • A Three.js viewer, LDraw export, and legacy inventory/pricing workflows.
  • A new physical-corpus audit that resolves inherited colors, flags unresolved inventory, separates flexible rendering geometry, and groups design families before splitting.

The older generation branches failed important reconstruction and free-running checks. Some historical reports counted procedural scaffold output as successful builds. Their provenance fields and experiment notes must be read before quoting metrics. The old curation filter checked duplicate origins; its stored stability_score values are not physical stability measurements.

Local use

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python scripts/serve_app.py --port 8080

Open http://localhost:8080 to inspect reference and catalog models. The existing application is not the acceptance test for the new generation objective. Model checkpoints, raw datasets, and LDraw libraries are local prerequisites and are not all distributed with this repository.

Active corpus audit

.venv/bin/python -m unittest scripts.test_physical_corpus
.venv/bin/python scripts/audit_physical_corpus.py

This uses the original 47 official and 198 legacy curated source records plus scratch/ldraw, the full local LDraw library. Output:

  • data/corpus_v2/audit.json: source provenance, inventory issues, family links, splits, and consulted library hashes.
  • data/corpus_v2/candidates.json: complete 40–600-piece parses awaiting construction and visual review.

The revised audit found 106 complete parses, including 96 size-band candidates spanning 65 conservatively grouped families. V2 fixes set-number title variants that separated related designs; V1 is retained for old experiment provenance. These candidate files have not all passed physical construction validation.

Current research direction

Start with pavilions and stepped towers, approximately 30 common part types, eight colors, upright connections, and an included physical base. Evaluate attachment-based generation against coordinate prediction before scaling local training. Measure complete builds against procedural and retrieval baselines.

The final evaluation must report every attempted generation, actual physical piece counts, supported construction checks, novelty, runtime, and memory. Aesthetic approval and real-world assembly require human evidence.

License

Project code is MIT licensed; see LICENSE. Third-party model files, part libraries, datasets, and dependencies retain their own licenses. LEGO is a trademark of the LEGO Group, which does not sponsor or endorse this project.