This project is a naive implementation of the paper Free-form Floor Plan Design using Differentiable Voronoi Diagram. The paper is based on the differentiable Voronoi diagram, but this repository uses Shapely
and Pytorch
. Specifically, PyTorch's autograd functionality for numerical differentiation is combined with Shapely's geometric operations to compute gradients. Also, the initialization method to assign room cells is different. I used the KMeans to converge the result faster than random initialization.
The detailed process for this project is archived here.
Optimization processes for
shape_a.py · shape_b.py · shape_c.py · shape_duck
This repository uses the image named python:3.10.12-slim
for running devcontainer.
-
Ensure you have Docker and Visual Studio Code with the Remote - Containers extension installed.
-
Clone the repository.
git clone https://github.com/PARKCHEOLHEE-lab/free-form-floor-plan-design-using-differentiable-voronoi-diagram.git
-
Open the project with VSCode.
-
When prompted at the bottom left on the VSCode, click
Reopen in Container
or use the command palette (F1) and selectRemote-Containers: Reopen in Container
. -
VS Code will build the Docker container and set up the environment.
-
Once the container is built and running, you're ready to start working with the project.
shape_a.py
: Orthogonal plan bounary a.shape_b.py
: Orthogonal plan bounary b.shape_c.py
: Orthogonal plan bounary c.shape_duck.py
: Duck-shaped plan boundary.
shape_<name>/<datetime>
configs.json
: Used configsevents.*
: Tensorboard logsoptimization.gif
: Animation for optimizing the shape
generator.py
: Voronoi diagram's sites generator.loss.py
: Loss functions based on the numerical differentiation to optimize the floor plans.shape.py
: Example shapes to test.
After installation, you can run any of the example files using the following commands:
python free_form_floor_plan_design_using_differentiable_voronoi_diagram/examples/shape_duck.py
python free_form_floor_plan_design_using_differentiable_voronoi_diagram/examples/shape_a.py
python free_form_floor_plan_design_using_differentiable_voronoi_diagram/examples/shape_b.py
python free_form_floor_plan_design_using_differentiable_voronoi_diagram/examples/shape_c.py
Each example will generate a floor plan based on different boundary shapes using the Voronoi diagram approach with the numerical differentiation and the geometric operations.
- Set entrances of the plan
- Set a graph-based constraint for the connectivity between rooms