About the Legonizer
The Legonizer is a research tool from the VCity team of the LIRIS lab. It turns 3D city models into brick models for augmented physical models: a table, white bricks, a projector and a screen.
Your data stays with you
Everything runs in your browser. Your 3D files are never uploaded. Plate links and QR codes carry the plate inside the link itself.
How it works
For every stud, the Legonizer measures the height of the city below it by casting a ray from above, then turns that height into a number of bricks.
The Legacy preset reproduces the UD-Viz 4.6.1 widget exactly, including its known limits, so researchers can compare results. Other options are improvements you choose.
The bricks are chosen layer by layer for each plate: as few bricks as possible, never crossing a plate edge, and overlapping the seams below so the model holds together.
Prepare your data
The Legonizer reads 3D Tiles, glTF/GLB, OBJ and CityJSON. Here is how to get one of them from the data you have.
From CityGML
Convert your CityGML files to CityJSON with citygml-tools, a free, maintained tool that reads CityGML 1.0, 2.0 and 3.0 (it needs Java 17 or later, or Docker). This command writes city.json next to city.gml; drop city.json on the Import step:
citygml-tools to-cityjson city.gml
A whole city is too big for a browser: cut out your district first, giving its corners in the coordinates of your file, then convert city__subset.gml:
citygml-tools subset --bbox minX,minY,maxX,maxY city.gml
py3dtilers, which this page suggested before, was discontinued in January 2025, and py3dtiles, which its authors point to, does not read CityGML.
From OpenStreetMap buildings
Export the buildings of your area as a 3D model (glTF or OBJ), for example with a Blender add-on that imports OpenStreetMap data. Check the size summary after import.
From Blender
Export as glTF 2.0 (.glb). Apply the object transforms first. If the model looks too small or too big after import, change the unit on the Import step.
From QGIS
Export your 3D scene to OBJ (3D map view, Export menu, Export 3D Scene). Keep the model in a projected coordinate system in metres.
Keep it light
Files up to about 2 million triangles (300 MB) work on a typical laptop. Crop to your district before exporting, or simplify the model.
Check units and orientation
After import, the summary shows the model's size in metres. A city 0.4 m wide means the unit is wrong: pick the right one in the summary. If buildings lie on their side, change the up axis.
About the files
- Height matrix (CSV): one line per row of studs, from north to south; one value per stud, from west to east, separated by semicolons; each value is a number of bricks.
- LDraw model: 1 stud = 20 LDraw units, a brick is 24 units high, colour 15 (white).
- Project file: input file names and fingerprints, area, settings, app version and heights. Opening it gives identical files.
The research
The Legonizer comes from research on augmented physical models of cities by C. Le Bihan Gautier, J. Delanoy and G. Gesquière, VCity team, LIRIS lab (CNRS, Université de Lyon).
C. Le Bihan Gautier, J. Delanoy, G. Gesquière. Représentation de l'évolution urbaine à travers une maquette tangible de territoires. Journées Françaises de l'Informatique Graphique (JFIG), Strasbourg, October 2024. hal-04924304. Licence CC0 1.0.
Read the paper on HAL UD-Viz on GitHub
It extends the Legonizer widget of UD-Viz, the VCity team's open-source framework for urban data.
C. Gautier. Représentations dynamiques, virtuelles et tangibles de la ville. PhD thesis in computer science, Université Lumière Lyon 2, defended on 22 May 2025. tel-05269366.
Read the thesis on HAL See a real project: the Gratte-Ciel model
Licences and credits
- legonizer 1.1.0 (core algorithm, reimplemented by this site): GPL-3.0 licence.
- UD-Viz Legonizer widget 4.6.1: LGPL-2.1 licence.
- Research paper and figures: CC0 1.0.
- Figures of the Gratte-Ciel example: from C. Gautier's PhD thesis (tel-05269366), reproduced by its author.
- Demo data: an invented sample district generated by the Legonizer, same licence as this site.
- This site's source code: GNU GPL licence, version 3 or later. You may modify and share it under the same licence. It comes with no warranty. Read the licence
- Website developed for fun by Jey Puget Gil and Corentin Gautier.
The district in the animation is invented, and so are the building uses, green spaces, tram lines, changes and pictures shown on it. The brick model is real output: our own pipeline turned that district into bricks.
Software and fonts used by this site
- three.js 0.186 (3D rendering): MIT licence.
- three-mesh-bvh (fast ray casting): MIT licence.
- fflate (zip files and compression): MIT licence.
- intl-messageformat (translations): BSD-3-Clause licence.
- pdf-lib (printable guide): MIT licence.
- qrcode (plate passes): MIT licence.
- Bricolage Grotesque, IBM Plex Sans and IBM Plex Mono: SIL Open Font Licence 1.1, served from this site (no request to a font service).
Trademark
LEGO® is a trademark of the LEGO Group, which does not sponsor, authorize or endorse this site. This site talks about bricks and does not use LEGO logos or trade dress.