Skip to content

Commit

Permalink
fix(grouping): Fix bug in previous space polygon implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jun 20, 2024
1 parent ae2ff8e commit f5a4e11
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions honeybee_doe2/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ def group_rooms_by_doe2_level(rooms, model_tolerance):
for room in room_group:
if room.properties.doe2.space_polygon_geometry is not None:
floor_geos.append(room.properties.doe2.space_polygon_geometry)
try:
flr_geo = room.horizontal_floor_boundaries(tolerance=model_tolerance)
if len(flr_geo) == 0: # possible when Rooms have no floors
flr_geo = room.horizontal_boundary(tolerance=model_tolerance)
floor_geos.append(flr_geo)
else:
floor_geos.extend(flr_geo)
except Exception: # level geometry is overlapping or not clean
pass
else:
try:
flr_geo = room.horizontal_floor_boundaries(tolerance=model_tolerance)
if len(flr_geo) == 0: # possible when Rooms have no floors
flr_geo = room.horizontal_boundary(tolerance=model_tolerance)
floor_geos.append(flr_geo)
else:
floor_geos.extend(flr_geo)
except Exception: # level geometry is overlapping or not clean
pass

# join all of the floors into horizontal boundaries
hor_bounds = _grouped_floor_boundary(floor_geos, model_tolerance)
Expand Down

0 comments on commit f5a4e11

Please sign in to comment.