generator.Room

This module will generate an architectural interior space with doors and windows.

Instructions for building generating your space are stored in a separate configuration file. The configuration is referenced by the "multi_room_config" parameter.

{
      "module": "generator.Room",
      "config": {
        "multi_room_config" : "roomConfig.yaml",
      }
} 

Room Properties

Each room is composed of the following properties.

  • "name": Each room is assigned a unique string. This is important. This label will be used to connect this room to other rooms and to apply placement rules.

  • "diagonal": Define the maximum and minimum size of your space.

  • "components": Add doors and windows to your space.

  • "connects": If this is defined when the rooms are rendered no wall will exist between the two spaces. For example, if you wanted the corridor to connect to the living room directly without a door. You would specify it as in the following example.

  • "has_wall": This property looks for the "connects" property. If rooms are connected and this value is false the rooms will be joined without a wall between them.

  {
    "name": "livingroom", #Unique room name
    "diagonal": [ #Diagonal line that defines the room size
      [0, 0],
      [[5, 8], [5, 7]],
    ],
    "components": [ #Add doors and windows to the walls
      {"type": "window", "size": 2, "segment": 2, "num": 2},
    ],
    "connects": ["corridor"] #Define if and how rooms connect
  }

Key Concepts

Generating a room in Lexset means you define a maximum and minimum size for the room. You also define where doors and windows get placed. To do this we have developed a unique way of describing these spaces.

Segments

Rooms are composed of segments. In the Lexset version 2, each room is composed of four segments.

In this example, we place a door on segment 1.

    "components": [
      {"type": "door", "size": 1.2, "segment": 1, "u": [0.4, 0.6]},
    ]

Global Coordinates

Coordinates defining room size need to represent a range of possible values and are expressed as a nested array. This is an example of how the .

[
    [xMin,xMax],[yMin,yMax],#First Point 
    [xMin,xMax],[yMin,yMax],#Second Point
]
    #Coordinates with a min and max range
    
    "diagonal": [
      [0, 1],[0,2],
      [[5, 8], [5, 7]], #xyz [between 5 and 7]
    ],
    
    #You can also explicitly define a point
    #In this example, the diagnal will always start at the origin.
    
    "diagonal": [
      [0,0],
      [[5, 8], [5, 7]], #xyz [between 5 and 7]
    ],

Local Coordinates

If an element is dependent on another element such as placing a window or a door on a wall you will define that objects location in local (U,V) coordinates.

In the following example, a 1.2M wide door is placed on "segment 1" (a wall within a room) around the center. The "u" position is defined as a range between, 0.4 and 0.6. This indicates the door can be located ~16.67% of the length of the wall off of the center.

"components": [
      {"type": "door", "size": 1.2, "segment": 1, "u": [0.4, 0.6]},
    ]

Last updated