As you can see, they are somehow placing models and scaling them to fit the rectangular shapes within this house. For visualisation (warning, art was never apart of my strong side):
My guess is that what is happening, it is finding all touching “nodes” at the end and start of each wall and when 4 nodes are touching, they group the parents of that node to form a room. Next step is where I am stumped. How is it drawing out the shapes (different sizes of rectangles) to fill the area surrounded by the walls?
parts = {}
while has empty space do
add findLargestRectangle(empty space) to parts
remove rectangle from the remaining empty space
end
For find largest rectangle the Google search you want is “find largest rectangle in matrix”, it’s a classic algorithms problem in computer science so there are many pieces of sample code out there for it.
That will give you a few large sections and some small details joining the large sections together, which is the structure that real examples tend to have.