Skip to content

taKana671/VoronoiCity2

Repository files navigation

VoronoiCity2

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.

Image

Requirements

  • Panda3D 1.10.16
  • numpy 2.2.6
  • shapely 2.1.2
  • scipy 1.16.2

Environment

  • Python 3.13
  • Windows11

Usage

Clone this repository with submodule.

git clone --recursive https://github.com/taKana671/VoronoiCity2.git

Execute the following command

python voronoi_city_2.py

Key control

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.
demo.mp4

About

VoronoiCity2 is a procedually created city in the image of old Tokyo office districts like Marunouchi.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages