Inspired by old Tokyo office districts like Marunouchi, I created an office district using an approach different from VoronoiCity. Using libraries like scipy and shapely, I generated bounded Voronoi regions, then scaled down each region to form roads. Each region was further Voronoi-partitioned, and random prisms were generated from the partitioned region vertices to form buildings. The layout of buildings and parks, as well as building heights, are dynamically calculated and therefore change each time the script is run.
- Panda3D 1.10.16
- numpy 2.2.6
- shapely 2.1.2
- scipy 1.16.2
- Python 3.13
- Windows11
git clone --recursive https://github.com/taKana671/VoronoiCity2.git
python voronoi_city_2.py
| key | description |
|---|---|
| Esc | Close the screen. |
| t | Toggles physical object display on and off. |
| w | Toggles wireframe display on and off. |
| v | Switch between sky view mode and moving view mode. |
In skyview mode, you can view the city from above and rotate the entire city by dragging the mouse.
moving view mode allows you to move around the city by keystrokes below.
| key | description |
|---|---|
| up arrow | Move forward. |
| left arrow | Turn left. |
| right arrow | Turn right. |
| down arrow | Move backward. |
| u | Go up. |
| d | Go down. |