A Reduction to the Floor Plan Generation Problem

The Spark ✨

This project is an exploration to find a solution to faster/easier/ai housing design by reducing the problem to a box stacking problem. In commercial housing plan, there seem to be a lot of pattern and logic that seems to be able to apply to a general set of housing design. I want to see if I can create a system that can generate valid floor plans based on a set of constraints.


The Foundation 🔨

The basic algorithm for this generator is to have an input of number of rooms and their room types, a site boundary, and then generate a floor plan that satisfies the constraints. The floor plan will then be filled with furnitures according to the room type and room sizes.

For different room types, they would produce different room sizes according to the most common/standard commercial room sizes. For example, a bedroom would be 10'x12', a bathroom would be 5'x8', and a kitchen would be around 10'x10'.

These blocks will then be placed into the boundary block using the first-fit bin-packing algorithm. I know this is not the perfect solution, but they are fast and simple to implement, and is a nice reduction to the complexity of the floor plan generation problem🤓️.


Turning Into Floor Plans 🏠
#1 Walls

The first step is adding thickness to the blocks to represent walls in a floor plan. The challenge in this step here is to detect adjacent/overlapping rooms, and union these walls to avoid any overlapping lines in the final floor plan.

#2 Doors

The next step is to add doors to the floor plan. I used an algorithm to detect room adjacency relationship, and then trim openings to place doors according to this room adjacency relationship. As different housing types have different door placements standards, the generator can take in different distances from the door to the wall.

#3 Furnitures

The next step would be placing & positioning furniture according to input room sizes. The furniture will be placed in an orientation that avoids door placements. When the room size allows, more furniture would be placed into the plan as fit. For example in this bedroom furniture placing algorithm, when there's space left, the bed size changes and bedside tables will be added when there's vacant spaces.


Combing Them Together ⛓️

Combining all the pieces together, we now have the ✨floor plan generator✨! Given an input number of rooms and a boundary, it will randomly generate a plan of different sizes of rooms. The floor plan will then be filled with furnitures according to the room type and room sizes.

With the same site boundary and different types of rooms, the generator will create a set of different plans!