Skip to content

Commit

Permalink
fix(multiphase): Use room display name for auto group naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Aug 20, 2024
1 parent 7c274ca commit 61503d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions honeybee_radiance/dynamic/multiphase.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def cluster_orientation(room_apertures, apertures, room_based=True, vertical_tol
for room_id, data in room_apertures.items():
_normal_list = []
grouped_apertures = []
ap_groups[room_id] = {}
for ap in data['apertures']:
# check if normal is already in list
n_bools = [ap.normal.is_equivalent(n, tolerance=0.01)
Expand Down Expand Up @@ -310,7 +311,8 @@ def cluster_orientation(room_apertures, apertures, room_based=True, vertical_tol
vertical_groups.extend(_ap_groups)
grouped_apertures = vertical_groups

ap_groups[room_id] = grouped_apertures
ap_groups[room_id]['aperture_groups'] = grouped_apertures
ap_groups[room_id]['display_name'] = data['display_name']
else:
_normal_list = []
grouped_apertures = []
Expand Down Expand Up @@ -352,10 +354,10 @@ def cluster_output(ap_groups, room_apertures, room_based=True):
group_names = []
group_dict = {}
if room_based:
for room_id, groups in ap_groups.items():
for idx, group in enumerate(groups):
for room_id, data in ap_groups.items():
for idx, group in enumerate(data['aperture_groups']):
ap_ids = [ap.identifier for ap in group]
group_name = '{}_ApertureGroup_{}'.format(room_id, idx)
group_name = '{}_ApertureGroup_{}'.format(data['display_name'], idx)
group_names.append(
{'identifier': group_name, 'apertures': ap_ids}
)
Expand Down
2 changes: 1 addition & 1 deletion honeybee_radiance/modifier/material/bsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, bsdf_file, identifier=None, up_orientation=None, thickness=0,
self.thickness = thickness or 0
aBSDF.__init__(self, bsdf_file, identifier, up_orientation, modifier,
function_file, transform, angle_basis, dependencies)

def _update_values(self):
"update value dictionaries."
n_path = os.path.normpath(self.bsdf_file).replace('\\', '/')
Expand Down

0 comments on commit 61503d9

Please sign in to comment.