Skip to main content

geometry.generator

GeometryGenerator Objects

class GeometryGenerator()

Used for programmatically generating geometries. Can create shoebox, l-shaped and polygon rooms.

create_shoebox_room

@staticmethod
def create_shoebox_room(project: Project,
model_name: str,
width_x: float,
depth_y: float,
height_z: float,
join_wall_layers: bool = True) -> ModelObj

Generate a shoebox room.

Arguments:

  • project: Project to add model to.
  • model_name: Name of model in project.
  • width_x: width of room (x axis)
  • depth_y: depth of room (y axis)
  • height_z: height of room (z axis)
  • join_wall_layers: if True walls will be put on a single layer, if False the model will have a layer for each wall in the room. Example with join_wall_layers set to True: ["shoebox_walls", "shoebox_floor", "shoebox_ceiling"] Example with join_wall_layers set to False: ["shoebox_wall_0", "shoebox_wall_1", "shoebox_wall_2", "shoebox_wall_3", "shoebox_floor", "shoebox_ceiling"]

create_l_shaped_room

@staticmethod
def create_l_shaped_room(project: Project,
model_name: str,
a_side: float,
b_side: float,
c_side: float,
d_side: float,
height_z: float,
join_wall_layers: bool = True) -> ModelObj

Create l-shaped room with sides as shown in the drawing below.

  __________
| | d
| ____|
| | c
| |
| | b
|_____|
0,0 a

Arguments:

  • project: Project to add model to.
  • model_name: Name of model in project.
  • join_wall_layers: if True walls will be put on a single layer, if False the model will have a layer for each wall in the room.

PointsGenerator Objects

class PointsGenerator()

generate_valid_points

@staticmethod
def generate_valid_points(
model: Union[str, ModelObj, GeometryLibraryObj],
max_count: int,
ruleset: validation.PointRuleset,
existing_receiver_points: List[float] = [],
existing_source_points: List[float] = []) -> List[List[float]]

Tries to generate max_count valid points within bounds of the model and within the rules of the provided ruleset.

Arguments:

  • model: Either a ModelObj, GeometryObj or a path to a valid 3dm model file.
  • max_count: Maximum number of points you can receive.
  • ruleset: What ruleset to use when validating points.
  • existing_receiver_points: Validate as if these receivers were in the model.
  • existing_source_points: Validate as if these sources were in the model.