This repository contains a script that generates a 3D model with Build123d library. It's a model generated from building footprints from Open Street Map (OSM) data. It uses floor levels information to approximate the height of these buildings.
Script that fetches OSM (Open Street Maps) data of buildings and generates a 3D model.
OSM uses labels to organize the city data. I'm using the following ones:
- building - to fetch all buildings in the area, including footprints
- building:levels - to fetch number of floors of the building (more reliable than height of the building)
I highly recommend using a virtual environment.
Then, installing requirements should be as easy as running pip install -r requirements.txt. But build123d and CadQuery use quite a complex set of interdependencies. If you encounter any issues, follow the recommended way to install the build123 package on pypi.
If you use Visual Studio Code, I recommend installing OCP CAD Viewer extension to preview the model during development.
Currently, Build123d doesn't support Python 3.13, that's why I'm using 3.12.
- osmnx - to fetch and parse OSM data
- build123d - to make a 3D model based on OSM data
- ocp_vscode - part of a Visual Studio Plugin to preview the generated 3D model
- folium - to visualise OSM data on a map, to compare the results with the 3D model
This project was inspired by Elk. A plugin to Grasshopper that takes Open Street Maps (OSM) data and fetches outlines of buildings. I thought it would be interesting to try to recreate it in Python.
