Skip to content

PARKCHEOLHEE-lab/free-form-floor-plan-design-using-differentiable-voronoi-diagram

Repository files navigation

free-form-floor-plan-design-using-differentiable-voronoi-diagram

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

Installation

This repository uses the image named python:3.10.12-slim for running devcontainer.

  1. Ensure you have Docker and Visual Studio Code with the Remote - Containers extension installed.

  2. Clone the repository.

        git clone https://github.com/PARKCHEOLHEE-lab/free-form-floor-plan-design-using-differentiable-voronoi-diagram.git
    
  3. Open the project with VSCode.

  4. When prompted at the bottom left on the VSCode, click Reopen in Container or use the command palette (F1) and select Remote-Containers: Reopen in Container.

  5. VS Code will build the Docker container and set up the environment.

  6. Once the container is built and running, you're ready to start working with the project.


File Details

examples

  • 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.

runs

  • shape_<name>/<datetime>
    • configs.json: Used configs
    • events.*: Tensorboard logs
    • optimization.gif: Animation for optimizing the shape

src

  • 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.

How to run

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.


Future works

  • Set entrances of the plan
  • Set a graph-based constraint for the connectivity between rooms

Releases

No releases published

Packages

No packages published