Room bound Algorithm

I am doing a research currently and want to implement an algorithm that identifies all spatial segments inside the drawing, similar to how revit computes a room given the walls.

I want to implement something similar in a 2d environment where the program can understand the different spaces/ rooms. Can someone point me in the right direction?

Note: I am not working with Revit for this research so using revit API is not an option.


What is your starting data format? DWG? PDF? SAT? JPG?

Iam still in the proposal stage but inclined towards images so probably jepgs.Is Revit using flood fil algorithm to achieve this?

Doesn’t matter what Revit is using as your data isn’t a vector (yet). Look into computer vision and contour recognition as this will likely get you started. I built a CV2 based Python 3 implementation to convert sketches recently with Dynamo. Pretty good results too.