Skip to content

Commit

Permalink
fix(lightpath): Make AirBoundary check recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Oct 5, 2022
1 parent 1d98d23 commit c74906a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions honeybee_radiance/lightpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,20 @@ def _get_room_light_path(model, room_identifier, static_name):

room, light_path = _get_room_light_path(model, room_identifier, static_name)

air_boundary_rooms = set()
# rooms with air boundaries should inherit the light path of rooms adjacent
# to the air boundary
for face in room.faces:
if isinstance(face.type, AirBoundary):
adj_room = face.boundary_condition.boundary_condition_objects[-1]
lp = _get_room_light_path(model, adj_room, static_name)[1]
light_path.extend(lp)
def _check_air_boundary(model, room, light_path, static_name):
air_boundary_rooms.add(room.identifier)
for face in room.faces:
if isinstance(face.type, AirBoundary):
adj_room = face.boundary_condition.boundary_condition_objects[-1]
if not adj_room in air_boundary_rooms:
air_boundary_rooms.add(adj_room)
room, lp = _get_room_light_path(model, adj_room, static_name)
light_path.extend(lp)
_check_air_boundary(model, room, light_path, static_name)

_check_air_boundary(model, room, light_path, static_name)

return light_path

0 comments on commit c74906a

Please sign in to comment.