honeybee-grasshopper-radiance 1.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honeybee_grasshopper_radiance/__init__.py +7 -0
- honeybee_grasshopper_radiance/src/HB Adjust HDR.py +107 -0
- honeybee_grasshopper_radiance/src/HB Ambient Resolution.py +63 -0
- honeybee_grasshopper_radiance/src/HB Annual Average Values.py +205 -0
- honeybee_grasshopper_radiance/src/HB Annual Cumulative Values.py +191 -0
- honeybee_grasshopper_radiance/src/HB Annual Daylight Metrics.py +209 -0
- honeybee_grasshopper_radiance/src/HB Annual Daylight.py +153 -0
- honeybee_grasshopper_radiance/src/HB Annual Glare Metrics.py +137 -0
- honeybee_grasshopper_radiance/src/HB Annual Irradiance.py +112 -0
- honeybee_grasshopper_radiance/src/HB Annual Peak Values.py +224 -0
- honeybee_grasshopper_radiance/src/HB Annual Results to Data.py +246 -0
- honeybee_grasshopper_radiance/src/HB Annual Sunlight Exposure.py +147 -0
- honeybee_grasshopper_radiance/src/HB Aperture Group Schedule.py +69 -0
- honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py +107 -0
- honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py +71 -0
- honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py +110 -0
- honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py +120 -0
- honeybee_grasshopper_radiance/src/HB Assign Grids and Views.py +58 -0
- honeybee_grasshopper_radiance/src/HB Automatic Aperture Group.py +100 -0
- honeybee_grasshopper_radiance/src/HB BSDF Modifier.py +78 -0
- honeybee_grasshopper_radiance/src/HB CIE Standard Sky.py +75 -0
- honeybee_grasshopper_radiance/src/HB Certain Illuminance.py +41 -0
- honeybee_grasshopper_radiance/src/HB Check Scene.py +208 -0
- honeybee_grasshopper_radiance/src/HB Climatebased Sky.py +75 -0
- honeybee_grasshopper_radiance/src/HB Cumulative Radiation.py +98 -0
- honeybee_grasshopper_radiance/src/HB Custom Sky.py +74 -0
- honeybee_grasshopper_radiance/src/HB Daylight Control Schedule.py +211 -0
- honeybee_grasshopper_radiance/src/HB Daylight Factor.py +82 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct Modifier.py +47 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct ModifierSet Interior.py +67 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct ModifierSet.py +80 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct Wea.py +44 -0
- honeybee_grasshopper_radiance/src/HB Direct Sun Hours.py +88 -0
- honeybee_grasshopper_radiance/src/HB Dynamic Aperture Group.py +90 -0
- honeybee_grasshopper_radiance/src/HB Dynamic Shade Group.py +95 -0
- honeybee_grasshopper_radiance/src/HB Dynamic State Geometry.py +68 -0
- honeybee_grasshopper_radiance/src/HB Dynamic State.py +44 -0
- honeybee_grasshopper_radiance/src/HB Exterior Modifier Subset.py +68 -0
- honeybee_grasshopper_radiance/src/HB Extract HDR.py +225 -0
- honeybee_grasshopper_radiance/src/HB False Color.py +246 -0
- honeybee_grasshopper_radiance/src/HB Get Dynamic Groups.py +57 -0
- honeybee_grasshopper_radiance/src/HB Get Grids and Views.py +82 -0
- honeybee_grasshopper_radiance/src/HB Glare Postprocess.py +225 -0
- honeybee_grasshopper_radiance/src/HB Glass Modifier 3.py +62 -0
- honeybee_grasshopper_radiance/src/HB Glass Modifier.py +58 -0
- honeybee_grasshopper_radiance/src/HB HDR to GIF.py +72 -0
- honeybee_grasshopper_radiance/src/HB Imageless Annual Glare.py +108 -0
- honeybee_grasshopper_radiance/src/HB Interior Modifier Subset.py +83 -0
- honeybee_grasshopper_radiance/src/HB Metal Modifier 3.py +70 -0
- honeybee_grasshopper_radiance/src/HB Metal Modifier.py +68 -0
- honeybee_grasshopper_radiance/src/HB Mirror Modifier 3.py +56 -0
- honeybee_grasshopper_radiance/src/HB Mirror Modifier.py +55 -0
- honeybee_grasshopper_radiance/src/HB Model to Rad Folder.py +75 -0
- honeybee_grasshopper_radiance/src/HB ModifierSet.py +127 -0
- honeybee_grasshopper_radiance/src/HB Opaque Modifier 3.py +68 -0
- honeybee_grasshopper_radiance/src/HB Opaque Modifier.py +67 -0
- honeybee_grasshopper_radiance/src/HB Point-In-Time Grid-Based.py +93 -0
- honeybee_grasshopper_radiance/src/HB Point-In-Time View-Based.py +127 -0
- honeybee_grasshopper_radiance/src/HB Radial Grid from Rooms.py +160 -0
- honeybee_grasshopper_radiance/src/HB Radial Sensor Grid.py +99 -0
- honeybee_grasshopper_radiance/src/HB Radiance Parameter.py +163 -0
- honeybee_grasshopper_radiance/src/HB Search Modifier Sets.py +58 -0
- honeybee_grasshopper_radiance/src/HB Search Modifiers.py +58 -0
- honeybee_grasshopper_radiance/src/HB Section Plane View.py +69 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Apertures.py +153 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Faces.py +147 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Rooms.py +210 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid.py +82 -0
- honeybee_grasshopper_radiance/src/HB Shade Modifier Subset.py +62 -0
- honeybee_grasshopper_radiance/src/HB Sky View.py +86 -0
- honeybee_grasshopper_radiance/src/HB Spatial Daylight Autonomy.py +86 -0
- honeybee_grasshopper_radiance/src/HB Subface Modifier Subset.py +90 -0
- honeybee_grasshopper_radiance/src/HB Translucent Modifier 3.py +77 -0
- honeybee_grasshopper_radiance/src/HB Translucent Modifier.py +77 -0
- honeybee_grasshopper_radiance/src/HB View from Viewport.py +85 -0
- honeybee_grasshopper_radiance/src/HB View.py +96 -0
- honeybee_grasshopper_radiance/src/HB Visualize Sky.py +141 -0
- honeybee_grasshopper_radiance/src/HB Wea From Clear Sky.py +61 -0
- honeybee_grasshopper_radiance/src/HB Wea From EPW.py +50 -0
- honeybee_grasshopper_radiance/src/HB Wea From Tau Clear Sky.py +56 -0
- honeybee_grasshopper_radiance/src/HB Wea from Zhang-Huang.py +63 -0
- honeybee_grasshopper_radiance/src/__init__.py +1 -0
- honeybee_grasshopper_radiance/user_objects/HB Adjust HDR.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Ambient Resolution.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Average Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Cumulative Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Daylight Metrics.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Daylight.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Glare Metrics.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Irradiance.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Peak Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Results to Data.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Sunlight Exposure.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Aperture Group Schedule.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser +0 -0
- Views.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Automatic Aperture Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB BSDF Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB CIE Standard Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Certain Illuminance.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Check Scene.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Climatebased Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Cumulative Radiation.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Custom Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Daylight Control Schedule.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Daylight Factor.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct ModifierSet Interior.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct Wea.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Direct Sun Hours.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic Aperture Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic Shade Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic State Geometry.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic State.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Exterior Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Extract HDR.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Face Radiance Attributes.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB False Color.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Get Dynamic Groups.ghuser +0 -0
- Views.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glare Postprocess.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glass Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glass Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB HDR to GIF.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Imageless Annual Glare.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Interior Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Metal Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Metal Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Mirror Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Mirror Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Model to Rad Folder.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Opaque Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Opaque Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Point-In-Time Grid-Based.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Point-In-Time View-Based.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radial Grid from Rooms.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radial Sensor Grid.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radiance Parameter.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Room Radiance Attributes.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Search Modifier Sets.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Search Modifiers.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Section Plane View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Apertures.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Faces.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Rooms.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Shade Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sky View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Spatial Daylight Autonomy.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Subface Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Translucent Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Translucent Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB View from Viewport.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Visualize Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From Clear Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From EPW.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From Tau Clear Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea from Zhang-Huang.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/__init__.py +1 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/METADATA +64 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/RECORD +170 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/WHEEL +5 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/licenses/LICENSE +661 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create a ModifierSet object containing all radiance modifiers needed to create
|
|
12
|
+
an radiance model. ModifierSets can be assigned to Honeybee Rooms to specify
|
|
13
|
+
all default modifiers on the Room.
|
|
14
|
+
-
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
_name_: Text to set the name for the ModifierSet and to be incorporated
|
|
18
|
+
into a unique ModifierSet identifier. If None, a random one will
|
|
19
|
+
be genrated.
|
|
20
|
+
base_mod_set_: An optional ModifierSet object that will be used
|
|
21
|
+
as the starting point for the new ModifierSet output from this
|
|
22
|
+
component. This can also be text for the name of a ModifierSet
|
|
23
|
+
within the library such as that output from the "HB Search Modifier
|
|
24
|
+
Sets" component. If None, the Honeybee "Generic Default Modifier
|
|
25
|
+
Set" will be used as the base.
|
|
26
|
+
_exterior_subset_: A modifier subset list from the "HB Exterior Modifier
|
|
27
|
+
Subset" component. Note that None values in this list correspond to
|
|
28
|
+
no change to the given modifier in the base_mod_set_.
|
|
29
|
+
_interior_subset_: A modifier subset list from the "HB Interior Modifier
|
|
30
|
+
Subset" component. Note that None values in this list correspond to
|
|
31
|
+
no change to the given modifier in the base_mod_set_.
|
|
32
|
+
_subface_subset_: A modifier subset list from the "HB Subface Subset"
|
|
33
|
+
component. Note that None values in this list correspond to no
|
|
34
|
+
change to the given modifier in the base_mod_set_.
|
|
35
|
+
_shade_subset_: A modifier subset list from the "HB Shade Modifier
|
|
36
|
+
Subset" component. Note that None values in this list correspond to
|
|
37
|
+
no change to the given modifier in the base_mod_set_.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
mod_set: A ModifierSet object that can be assigned to Honeybee
|
|
41
|
+
Rooms in order to specify all default modifiers on the Room.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
ghenv.Component.Name = 'HB ModifierSet'
|
|
45
|
+
ghenv.Component.NickName = 'ModifierSet'
|
|
46
|
+
ghenv.Component.Message = '1.9.0'
|
|
47
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
48
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
49
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '3'
|
|
50
|
+
|
|
51
|
+
try: # import the core honeybee dependencies
|
|
52
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
53
|
+
except ImportError as e:
|
|
54
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
55
|
+
|
|
56
|
+
try: # import the honeybee-radiance dependencies
|
|
57
|
+
from honeybee_radiance.modifierset import ModifierSet
|
|
58
|
+
from honeybee_radiance.lib.modifiersets import modifier_set_by_identifier
|
|
59
|
+
except ImportError as e:
|
|
60
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
61
|
+
|
|
62
|
+
try: # import ladybug_rhino dependencies
|
|
63
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
64
|
+
except ImportError as e:
|
|
65
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
66
|
+
turn_off_old_tag(ghenv.Component)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# get the base modifier set
|
|
70
|
+
name = clean_and_id_rad_string('ModifierSet') if _name_ is None else \
|
|
71
|
+
clean_rad_string(_name_)
|
|
72
|
+
if base_mod_set_ is None:
|
|
73
|
+
mod_set = ModifierSet(name)
|
|
74
|
+
else:
|
|
75
|
+
if isinstance(base_mod_set_, str):
|
|
76
|
+
base_mod_set_ = modifier_set_by_identifier(base_mod_set_)
|
|
77
|
+
mod_set = base_mod_set_.duplicate()
|
|
78
|
+
mod_set.identifier = name
|
|
79
|
+
if _name_ is not None:
|
|
80
|
+
mod_set.display_name = _name_
|
|
81
|
+
|
|
82
|
+
# go through each input modifier subset and assign it to the set
|
|
83
|
+
if len(_exterior_subset_) != 0:
|
|
84
|
+
assert len(_exterior_subset_) == 3, 'Input _exterior_subset_ is not valid.'
|
|
85
|
+
if _exterior_subset_[0] is not None:
|
|
86
|
+
mod_set.wall_set.exterior_modifier = _exterior_subset_[0]
|
|
87
|
+
if _exterior_subset_[1] is not None:
|
|
88
|
+
mod_set.roof_ceiling_set.exterior_modifier = _exterior_subset_[1]
|
|
89
|
+
if _exterior_subset_[2] is not None:
|
|
90
|
+
mod_set.floor_set.exterior_modifier = _exterior_subset_[2]
|
|
91
|
+
|
|
92
|
+
if len(_interior_subset_) != 0:
|
|
93
|
+
assert len(_interior_subset_) == 6, 'Input _interior_subset_ is not valid.'
|
|
94
|
+
if _interior_subset_[0] is not None:
|
|
95
|
+
mod_set.wall_set.interior_modifier = _interior_subset_[0]
|
|
96
|
+
if _interior_subset_[1] is not None:
|
|
97
|
+
mod_set.roof_ceiling_set.interior_modifier = _interior_subset_[1]
|
|
98
|
+
if _interior_subset_[2] is not None:
|
|
99
|
+
mod_set.floor_set.interior_modifier = _interior_subset_[2]
|
|
100
|
+
if _interior_subset_[3] is not None:
|
|
101
|
+
mod_set.aperture_set.interior_modifier = _interior_subset_[3]
|
|
102
|
+
if _interior_subset_[4] is not None:
|
|
103
|
+
mod_set.door_set.interior_modifier = _interior_subset_[4]
|
|
104
|
+
if _interior_subset_[5] is not None:
|
|
105
|
+
mod_set.door_set.interior_glass_modifier = _interior_subset_[5]
|
|
106
|
+
|
|
107
|
+
if len(_subface_subset_) != 0:
|
|
108
|
+
assert len(_subface_subset_) == 6, 'Input _subface_subset_ is not valid.'
|
|
109
|
+
if _subface_subset_[0] is not None:
|
|
110
|
+
mod_set.aperture_set.window_modifier = _subface_subset_[0]
|
|
111
|
+
if _subface_subset_[1] is not None:
|
|
112
|
+
mod_set.aperture_set.skylight_modifier = _subface_subset_[1]
|
|
113
|
+
if _subface_subset_[2] is not None:
|
|
114
|
+
mod_set.aperture_set.operable_modifier = _subface_subset_[2]
|
|
115
|
+
if _subface_subset_[3] is not None:
|
|
116
|
+
mod_set.door_set.exterior_modifier = _subface_subset_[3]
|
|
117
|
+
if _subface_subset_[4] is not None:
|
|
118
|
+
mod_set.door_set.overhead_modifier = _subface_subset_[4]
|
|
119
|
+
if _subface_subset_[5] is not None:
|
|
120
|
+
mod_set.door_set.exterior_glass_modifier = _subface_subset_[5]
|
|
121
|
+
|
|
122
|
+
if len(_shade_subset_) != 0:
|
|
123
|
+
assert len(_shade_subset_) == 2, 'Input _shade_subset_ is not valid.'
|
|
124
|
+
if _shade_subset_[0] is not None:
|
|
125
|
+
mod_set.shade_set.exterior_modifier = _shade_subset_[0]
|
|
126
|
+
if _shade_subset_[1] is not None:
|
|
127
|
+
mod_set.shade_set.interior_modifier = _shade_subset_[1]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create an opaque radiance modifier from red, green, and blue reflectances.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
_name_: Text to set the name for the modifier and to be incorporated into
|
|
16
|
+
a unique modifier identifier.
|
|
17
|
+
_r_ref: A number between 0 and 1 for the absolute diffuse red reflectance.
|
|
18
|
+
_g_ref: A number between 0 and 1 for the absolute diffuse green reflectance.
|
|
19
|
+
_b_ref: A number between 0 and 1 for the absolute diffuse blue reflectance.
|
|
20
|
+
_spec_: A number between 0 and 1 for the absolute specular reflectance of the modifier.
|
|
21
|
+
Note that the sum of this value and the diffuse should be less
|
|
22
|
+
than one. Specular reflectances greater than 0.1 are rare for
|
|
23
|
+
non-metallic materials. (Default: 0).
|
|
24
|
+
_rough_: Roughness is specified as the rms slope of surface facets. A value
|
|
25
|
+
of 0 corresponds to a perfectly smooth surface, and a value of 1 would be
|
|
26
|
+
a very rough surface. Roughness values greater than 0.2 are not very
|
|
27
|
+
realistic. (Default: 0).
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
modifier: An opaque modifier that can be assigned to a Honeybee geometry
|
|
31
|
+
or Modifier Sets.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
ghenv.Component.Name = 'HB Opaque Modifier 3'
|
|
35
|
+
ghenv.Component.NickName = 'OpaqueMod3'
|
|
36
|
+
ghenv.Component.Message = '1.9.0'
|
|
37
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
38
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
39
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '0'
|
|
40
|
+
|
|
41
|
+
try: # import the core honeybee dependencies
|
|
42
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
43
|
+
except ImportError as e:
|
|
44
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
45
|
+
|
|
46
|
+
try: # import the honeybee-radiance dependencies
|
|
47
|
+
from honeybee_radiance.modifier.material import Plastic
|
|
48
|
+
except ImportError as e:
|
|
49
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
50
|
+
|
|
51
|
+
try: # import ladybug_rhino dependencies
|
|
52
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
53
|
+
except ImportError as e:
|
|
54
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if all_required_inputs(ghenv.Component):
|
|
58
|
+
# set the default modifier properties
|
|
59
|
+
_spec_ = 0.0 if _spec_ is None else _spec_
|
|
60
|
+
_rough_ = 0.0 if _rough_ is None else _rough_
|
|
61
|
+
name = clean_and_id_rad_string('OpaqueMaterial') if _name_ is None else \
|
|
62
|
+
clean_rad_string(_name_)
|
|
63
|
+
|
|
64
|
+
# create the modifier
|
|
65
|
+
modifier = Plastic.from_reflected_specularity(
|
|
66
|
+
name, _r_ref, _g_ref, _b_ref, _spec_, _rough_)
|
|
67
|
+
if _name_ is not None:
|
|
68
|
+
modifier.display_name = _name_
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create an opaque radiance modifier from a single reflectance.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
_name_: Text to set the name for the modifier and to be incorporated into
|
|
16
|
+
a unique modifier identifier.
|
|
17
|
+
_reflect: A number between 0 and 1 for the absolute diffuse reflectance of the modifier.
|
|
18
|
+
This reflectance will be the same for the red, green and blue channels.
|
|
19
|
+
_spec_: A number between 0 and 1 for the absolute specular reflectance of the modifier.
|
|
20
|
+
Note that the sum of this value and the diffuse _reflect should be less than one.
|
|
21
|
+
Specular reflectances greater than 0.1 are rare for non-metallic
|
|
22
|
+
materials. (Default: 0).
|
|
23
|
+
_rough_: Roughness is specified as the rms slope of surface facets. A value
|
|
24
|
+
of 0 corresponds to a perfectly smooth surface, and a value of 1 would be
|
|
25
|
+
a very rough surface. Roughness values greater than 0.2 are not very
|
|
26
|
+
realistic. (Default: 0).
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
modifier: An opaque modifier that can be assigned to a Honeybee geometry
|
|
30
|
+
or Modifier Sets.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
ghenv.Component.Name = 'HB Opaque Modifier'
|
|
34
|
+
ghenv.Component.NickName = 'OpaqueMod'
|
|
35
|
+
ghenv.Component.Message = '1.9.0'
|
|
36
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
37
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
38
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
39
|
+
|
|
40
|
+
try: # import the core honeybee dependencies
|
|
41
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
42
|
+
except ImportError as e:
|
|
43
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
44
|
+
|
|
45
|
+
try: # import the honeybee-radiance dependencies
|
|
46
|
+
from honeybee_radiance.modifier.material import Plastic
|
|
47
|
+
except ImportError as e:
|
|
48
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
49
|
+
|
|
50
|
+
try: # import ladybug_rhino dependencies
|
|
51
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
52
|
+
except ImportError as e:
|
|
53
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if all_required_inputs(ghenv.Component):
|
|
57
|
+
# set the default modifier properties
|
|
58
|
+
_spec_ = 0.0 if _spec_ is None else _spec_
|
|
59
|
+
_rough_ = 0.0 if _rough_ is None else _rough_
|
|
60
|
+
name = clean_and_id_rad_string('OpaqueMaterial') if _name_ is None else \
|
|
61
|
+
clean_rad_string(_name_)
|
|
62
|
+
|
|
63
|
+
# create the modifier
|
|
64
|
+
modifier = Plastic.from_reflected_specularity(
|
|
65
|
+
name, _reflect, _reflect, _reflect, _spec_, _rough_)
|
|
66
|
+
if _name_ is not None:
|
|
67
|
+
modifier.display_name = _name_
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Run a point-in-time grid-based study for a Honeybee model.
|
|
12
|
+
_
|
|
13
|
+
Point-in-time recipes require a sky and can output illuminance, irradiance,
|
|
14
|
+
luminance or radiance.
|
|
15
|
+
|
|
16
|
+
-
|
|
17
|
+
Args:
|
|
18
|
+
_model: A Honeybee Model for which a point-in-time grid-based study will be run.
|
|
19
|
+
Note that this model should have grids assigned to it in order
|
|
20
|
+
to produce meaningfule results.
|
|
21
|
+
_sky: A Radiance sky from any of the sky components under the "Light Sources" tab.
|
|
22
|
+
Skies can be either CIE, ClimateBased/Custom, or for a specific
|
|
23
|
+
Illuminance/Irradiance. This input can also just be a text definition
|
|
24
|
+
of a sky's paramters. Examples include:
|
|
25
|
+
* cie 21 Mar 9:00 -lat 41.78 -lon -87.75 -tz 5 -type 0
|
|
26
|
+
* climate-based 21 Jun 12:00 -lat 41.78 -lon -87.75 -tz 5 -dni 800 -dhi 120
|
|
27
|
+
* irradiance 0
|
|
28
|
+
_metric_: Either an integer or the full name of a point-in-time metric to be computed
|
|
29
|
+
by the recipe. (Default: illuminance). Choose from the following:
|
|
30
|
+
* 0 = illuminance
|
|
31
|
+
* 1 = irradiance
|
|
32
|
+
* 2 = luminance
|
|
33
|
+
* 3 = radiance
|
|
34
|
+
grid_filter_: Text for a grid identifer or a pattern to filter the sensor grids of
|
|
35
|
+
the model that are simulated. For instance, `first_floor_*` will simulate
|
|
36
|
+
only the sensor grids that have an identifier that starts with
|
|
37
|
+
`first_floor_`. By default, all grids in the model will be simulated.
|
|
38
|
+
radiance_par_: Text for the radiance parameters to be used for ray
|
|
39
|
+
tracing. (Default: -ab 2 -aa 0.1 -ad 2048 -ar 64).
|
|
40
|
+
run_settings_: Settings from the "HB Recipe Settings" component that specify
|
|
41
|
+
how the recipe should be run. This can also be a text string of
|
|
42
|
+
recipe settings.
|
|
43
|
+
_run: Set to True to run the recipe and get results. This input can also be
|
|
44
|
+
the integer "2" to run the recipe silently.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
report: Reports, errors, warnings, etc.
|
|
48
|
+
results: Numbers for the point-in-time value at each sensor. Values are in the
|
|
49
|
+
standard SI units of the requested input metric. These can be plugged
|
|
50
|
+
into the "LB Spatial Heatmap" component along with meshes of the
|
|
51
|
+
sensor grids to visualize results.
|
|
52
|
+
* illuminance = lux (aka. lm/m2)
|
|
53
|
+
* irradiance = W/m2
|
|
54
|
+
* luminance = cd/m2 (aka. lm/m2-sr)
|
|
55
|
+
* radiance = W/m2-sr
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
ghenv.Component.Name = 'HB Point-In-Time Grid-Based'
|
|
59
|
+
ghenv.Component.NickName = 'PITGrid'
|
|
60
|
+
ghenv.Component.Message = '1.9.0'
|
|
61
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
62
|
+
ghenv.Component.SubCategory = '3 :: Recipes'
|
|
63
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
from lbt_recipes.recipe import Recipe
|
|
67
|
+
except ImportError as e:
|
|
68
|
+
raise ImportError('\nFailed to import lbt_recipes:\n\t{}'.format(e))
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
from ladybug_rhino.grasshopper import all_required_inputs, recipe_result
|
|
72
|
+
except ImportError as e:
|
|
73
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if all_required_inputs(ghenv.Component) and _run:
|
|
77
|
+
# create the recipe and set the input arguments
|
|
78
|
+
recipe = Recipe('point-in-time-grid')
|
|
79
|
+
recipe.input_value_by_name('model', _model)
|
|
80
|
+
recipe.input_value_by_name('sky', _sky)
|
|
81
|
+
recipe.input_value_by_name('metric', _metric_)
|
|
82
|
+
recipe.input_value_by_name('grid-filter', grid_filter_)
|
|
83
|
+
recipe.input_value_by_name('radiance-parameters', radiance_par_)
|
|
84
|
+
|
|
85
|
+
# run the recipe
|
|
86
|
+
silent = True if _run > 1 else False
|
|
87
|
+
project_folder = recipe.run(run_settings_, radiance_check=True, silent=silent)
|
|
88
|
+
|
|
89
|
+
# load the results
|
|
90
|
+
try:
|
|
91
|
+
results = recipe_result(recipe.output_value_by_name('results', project_folder))
|
|
92
|
+
except Exception:
|
|
93
|
+
raise Exception(recipe.failure_message(project_folder))
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Run a point-in-time view-based study for a Honeybee model.
|
|
12
|
+
_
|
|
13
|
+
Point-in-time view-based recipes require a sky and can output High Dynamic Range
|
|
14
|
+
(HDR) images of illuminance, irradiance, luminance or radiance.
|
|
15
|
+
_
|
|
16
|
+
The `view_count_` input can be used to split each view for parallel processing,
|
|
17
|
+
producing multiple images that are recombined into a single .HDR for the view at
|
|
18
|
+
the end of the recipe. The recombination process automatically includes an
|
|
19
|
+
anti-aliasing pass that smooths and improves the quality of the image. The recipe
|
|
20
|
+
also performs an overture calculation prior to splitting each view, which results
|
|
21
|
+
in an image with better interpolation between neighboring pixels.
|
|
22
|
+
|
|
23
|
+
-
|
|
24
|
+
Args:
|
|
25
|
+
_model: A Honeybee Model for which a point-in-time view-based study will be run.
|
|
26
|
+
Note that this model should have views assigned to it in order
|
|
27
|
+
to produce meaningfule results.
|
|
28
|
+
_sky: A Radiance sky from any of the sky components under the "Light Sources" tab.
|
|
29
|
+
Skies can be either CIE, ClimateBased/Custom, or for a specific
|
|
30
|
+
Illuminance/Irradiance. This input can also just be a text definition
|
|
31
|
+
of a sky's paramters. Examples include:
|
|
32
|
+
* cie 21 Mar 9:00 -lat 41.78 -lon -87.75 -tz 5 -type 0
|
|
33
|
+
* climate-based 21 Jun 12:00 -lat 41.78 -lon -87.75 -tz 5 -dni 800 -dhi 120
|
|
34
|
+
* irradiance 0
|
|
35
|
+
_metric_: Either an integer or the full name of a point-in-time metric to be
|
|
36
|
+
computed by the recipe. (Default: luminance). Choose from the following:
|
|
37
|
+
* 0 = illuminance
|
|
38
|
+
* 1 = irradiance
|
|
39
|
+
* 2 = luminance
|
|
40
|
+
* 3 = radiance
|
|
41
|
+
_resolution_: An integer for the maximum dimension of each image in pixels
|
|
42
|
+
(either width or height depending on the input view angle and
|
|
43
|
+
type). (Default: 800).
|
|
44
|
+
view_filter_: Text for a view identifer or a pattern to filter the views of the
|
|
45
|
+
model that are simulated. For instance, `first_floor_*` will simulate
|
|
46
|
+
only the views that have an identifier that starts with `first_floor_`.
|
|
47
|
+
By default, all views in the model will be simulated.
|
|
48
|
+
skip_overture_: A boolean to note whether an ambient file (.amb) should be
|
|
49
|
+
generated for an overture calculation before the view is split
|
|
50
|
+
into smaller views. With an overture calculation, the ambient file
|
|
51
|
+
(aka ambient cache) is first populated with values. Thereby ensuring
|
|
52
|
+
that - when reused to create an image - Radiance uses interpolation
|
|
53
|
+
between already calculated values rather than less reliable
|
|
54
|
+
extrapolation. The overture calculation has comparatively small
|
|
55
|
+
computation time to full rendering but is single-core can become
|
|
56
|
+
time consuming in situations with a high view_count_ and workers.
|
|
57
|
+
radiance_par_: Text for the radiance parameters to be used for ray
|
|
58
|
+
tracing. (Default: -ab 2 -aa 0.25 -ad 512 -ar 16).
|
|
59
|
+
run_settings_: Settings from the "HB Recipe Settings" component that specify
|
|
60
|
+
how the recipe should be run. This can also be a text string of
|
|
61
|
+
recipe settings.
|
|
62
|
+
_run: Set to True to run the recipe and get results. This input can also be
|
|
63
|
+
the integer "2" to run the recipe silently.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
report: Reports, errors, warnings, etc.
|
|
67
|
+
results: High Dynamic Range (HDR) images for each View in the model. These can be
|
|
68
|
+
plugged into the Ladybug "Image Viewer" component to preview the image.
|
|
69
|
+
They can also be plugged into the "HB False Color" component to convert
|
|
70
|
+
the image into a false color version. Lastly, it can be connected to
|
|
71
|
+
the "HB HDR to GIF" component to get a GIF image that is more portable
|
|
72
|
+
and easily previewed by different software. Pixel values are in the
|
|
73
|
+
standard SI units of the requested input metric.
|
|
74
|
+
* illuminance = lux (aka. lm/m2)
|
|
75
|
+
* irradiance = W/m2
|
|
76
|
+
* luminance = cd/m2 (aka. lm/m2-sr)
|
|
77
|
+
* radiance = W/m2-sr
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
ghenv.Component.Name = 'HB Point-In-Time View-Based'
|
|
81
|
+
ghenv.Component.NickName = 'PITView'
|
|
82
|
+
ghenv.Component.Message = '1.9.0'
|
|
83
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
84
|
+
ghenv.Component.SubCategory = '3 :: Recipes'
|
|
85
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
86
|
+
|
|
87
|
+
import os
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
from honeybee.model import Model
|
|
91
|
+
except ImportError as e:
|
|
92
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
93
|
+
|
|
94
|
+
try:
|
|
95
|
+
from lbt_recipes.recipe import Recipe
|
|
96
|
+
except ImportError as e:
|
|
97
|
+
raise ImportError('\nFailed to import lbt_recipes:\n\t{}'.format(e))
|
|
98
|
+
|
|
99
|
+
try:
|
|
100
|
+
from ladybug_rhino.grasshopper import all_required_inputs, recipe_result, \
|
|
101
|
+
recommended_processor_count
|
|
102
|
+
except ImportError as e:
|
|
103
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
if all_required_inputs(ghenv.Component) and _run:
|
|
107
|
+
# create the recipe and set the input arguments
|
|
108
|
+
recipe = Recipe('point-in-time-view')
|
|
109
|
+
recipe.input_value_by_name('model', _model)
|
|
110
|
+
recipe.input_value_by_name('sky', _sky)
|
|
111
|
+
recipe.input_value_by_name('metric', _metric_)
|
|
112
|
+
recipe.input_value_by_name('resolution', _resolution_)
|
|
113
|
+
recipe.input_value_by_name('view-filter', view_filter_)
|
|
114
|
+
recipe.input_value_by_name('skip-overture', skip_overture_)
|
|
115
|
+
recipe.input_value_by_name('radiance-parameters', radiance_par_)
|
|
116
|
+
|
|
117
|
+
# run the recipe
|
|
118
|
+
silent = True if _run > 1 else False
|
|
119
|
+
project_folder = recipe.run(run_settings_, radiance_check=True, silent=silent)
|
|
120
|
+
|
|
121
|
+
# load the results
|
|
122
|
+
try:
|
|
123
|
+
results = recipe_result(recipe.output_value_by_name('results', project_folder))
|
|
124
|
+
if hasattr(results, 'BranchCount') and results.BranchCount == 0:
|
|
125
|
+
raise ValueError()
|
|
126
|
+
except Exception:
|
|
127
|
+
raise Exception(recipe.failure_message(project_folder))
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Generate SensorGrids of radial directions around positions from the floors of rooms.
|
|
12
|
+
_
|
|
13
|
+
This type of sensor grid is particularly helpful for studies of multiple view
|
|
14
|
+
directions, such as imageless glare studies.
|
|
15
|
+
_
|
|
16
|
+
The names of the grids will be the same as the rooms that they came from.
|
|
17
|
+
-
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
_rooms: A list of honeybee Rooms for which sensor grids will be generated.
|
|
21
|
+
This can also be an entire Honeybee Model from which Rooms will
|
|
22
|
+
be extracted.
|
|
23
|
+
_grid_size: Number for the size of the grid cells.
|
|
24
|
+
_dist_floor_: Number for the distance to move points from the floors of
|
|
25
|
+
the input rooms. (Default: 1.2 meters).
|
|
26
|
+
_dir_count_: A positive integer for the number of radial directions to be
|
|
27
|
+
generated around each position. (Default: 8).
|
|
28
|
+
_start_vec_: A Vector3D to set the start direction of the generated directions.
|
|
29
|
+
This can be used to orient the resulting sensors to specific parts
|
|
30
|
+
of the scene. It can also change the elevation of the resulting
|
|
31
|
+
directions since this start vector will always be rotated in the
|
|
32
|
+
XY plane to generate the resulting directions. (Default: (0, -1, 0)).
|
|
33
|
+
wall_offset_: A number for the distance at which sensors close to walls
|
|
34
|
+
should be removed.
|
|
35
|
+
by_zone_: Set to "True" to have the component generate one sensor grid per zone
|
|
36
|
+
across the input rooms rather than one sensor grid per room. This
|
|
37
|
+
option is useful for getting a more consolidated set of Radiance
|
|
38
|
+
results by zone. (Default: False).
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
grid: A SensorGrid object that can be used in a grid-based recipe.
|
|
42
|
+
points: The points that are at the center of each circle. These align with
|
|
43
|
+
the vecs output below and can be visualized with the native
|
|
44
|
+
Grasshopper vector display component.
|
|
45
|
+
vecs: The vectors for the directions of each sensor. These align with
|
|
46
|
+
the points output above and can be visualized with the native
|
|
47
|
+
Grasshopper vector display component.
|
|
48
|
+
mesh: Analysis mesh that can be passed to the 'Spatial Heatmap' component.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
ghenv.Component.Name = 'HB Radial Grid from Rooms'
|
|
52
|
+
ghenv.Component.NickName = 'RadialGridRooms'
|
|
53
|
+
ghenv.Component.Message = '1.9.1'
|
|
54
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
55
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
56
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '4'
|
|
57
|
+
|
|
58
|
+
from collections import OrderedDict
|
|
59
|
+
|
|
60
|
+
try: # import the ladybug_geometry dependencies
|
|
61
|
+
from ladybug_geometry.geometry3d import Vector3D, Point3D, Mesh3D
|
|
62
|
+
except ImportError as e:
|
|
63
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
64
|
+
|
|
65
|
+
try: # import the core honeybee dependencies
|
|
66
|
+
from honeybee.model import Model
|
|
67
|
+
from honeybee.room import Room
|
|
68
|
+
from honeybee.typing import clean_rad_string
|
|
69
|
+
except ImportError as e:
|
|
70
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
from honeybee_radiance.sensorgrid import SensorGrid
|
|
74
|
+
except ImportError as e:
|
|
75
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
76
|
+
|
|
77
|
+
try: # import ladybug_rhino dependencies
|
|
78
|
+
from ladybug_rhino.config import conversion_to_meters
|
|
79
|
+
from ladybug_rhino.togeometry import to_vector3d
|
|
80
|
+
from ladybug_rhino.fromgeometry import from_mesh3d, from_point3d, from_vector3d
|
|
81
|
+
from ladybug_rhino.grasshopper import all_required_inputs, list_to_data_tree
|
|
82
|
+
except ImportError as e:
|
|
83
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
if all_required_inputs(ghenv.Component):
|
|
87
|
+
# set defaults for any blank inputs and process the quad_only_
|
|
88
|
+
_dist_floor_ = 1.2 / conversion_to_meters() if _dist_floor_ is None else _dist_floor_
|
|
89
|
+
wall_offset = 0 if wall_offset_ is None else wall_offset_
|
|
90
|
+
dir_count = 8 if _dir_count_ is None else _dir_count_
|
|
91
|
+
try:
|
|
92
|
+
st_vec = to_vector3d(_start_vec_)
|
|
93
|
+
except AttributeError:
|
|
94
|
+
st_vec = Vector3D(0, -1, 0)
|
|
95
|
+
|
|
96
|
+
# gather all of the rooms
|
|
97
|
+
rooms = []
|
|
98
|
+
for obj in _rooms:
|
|
99
|
+
if isinstance(obj, Model):
|
|
100
|
+
rooms.extend(obj.rooms)
|
|
101
|
+
elif isinstance(obj, Room):
|
|
102
|
+
rooms.append(obj)
|
|
103
|
+
else:
|
|
104
|
+
raise TypeError('Expected Honeybee Room or Model. Got {}.'.format(type(obj)))
|
|
105
|
+
|
|
106
|
+
# group the rooms by zone if requested
|
|
107
|
+
if by_zone_:
|
|
108
|
+
room_groups = OrderedDict()
|
|
109
|
+
for room in rooms:
|
|
110
|
+
try:
|
|
111
|
+
room_groups[room.zone].append(room)
|
|
112
|
+
except KeyError: # first room to be found in the zone
|
|
113
|
+
room_groups[room.zone] = [room]
|
|
114
|
+
else:
|
|
115
|
+
room_groups = OrderedDict([(room.identifier, [room]) for room in rooms])
|
|
116
|
+
|
|
117
|
+
# create lists to be filled with content
|
|
118
|
+
grid, points, vecs, mesh = [], [], [], []
|
|
119
|
+
|
|
120
|
+
# loop through the rooms and create the grids
|
|
121
|
+
for zone_id, room_group in room_groups.items():
|
|
122
|
+
# get the base meshs
|
|
123
|
+
floor_meshes = []
|
|
124
|
+
for room in room_group:
|
|
125
|
+
floor_mesh = room.properties.radiance._base_sensor_mesh(
|
|
126
|
+
_grid_size, _grid_size, offset=_dist_floor_, remove_out=True,
|
|
127
|
+
wall_offset=wall_offset)
|
|
128
|
+
if floor_mesh is not None:
|
|
129
|
+
floor_meshes.append(floor_mesh)
|
|
130
|
+
if len(floor_meshes) == 0:
|
|
131
|
+
continue
|
|
132
|
+
floor_grid = Mesh3D.join_meshes(floor_meshes) \
|
|
133
|
+
if len(floor_meshes) != 1 else floor_meshes[0]
|
|
134
|
+
|
|
135
|
+
# create the sensor grid from the mesh
|
|
136
|
+
mesh_radius = _grid_size * 0.45
|
|
137
|
+
sg_name = room.display_name if not by_zone_ else zone_id
|
|
138
|
+
grid_name = '{}_Radial'.format(clean_rad_string(sg_name))
|
|
139
|
+
s_grid = SensorGrid.from_mesh3d_radial(
|
|
140
|
+
grid_name, floor_grid, dir_count=dir_count, start_vector=st_vec,
|
|
141
|
+
mesh_radius=mesh_radius)
|
|
142
|
+
s_grid.room_identifier = room_group[0].identifier
|
|
143
|
+
s_grid.display_name = sg_name
|
|
144
|
+
|
|
145
|
+
# add the relevant items to the outputs
|
|
146
|
+
grid.append(s_grid)
|
|
147
|
+
sensors = s_grid.sensors
|
|
148
|
+
base_points = [from_point3d(Point3D(*sen.pos)) for sen in sensors]
|
|
149
|
+
base_vecs = [from_vector3d(Vector3D(*sen.dir)) for sen in sensors]
|
|
150
|
+
points.append(base_points)
|
|
151
|
+
vecs.append(base_vecs)
|
|
152
|
+
lb_mesh = s_grid.mesh
|
|
153
|
+
if lb_mesh is not None:
|
|
154
|
+
mesh.append(from_mesh3d(lb_mesh))
|
|
155
|
+
else:
|
|
156
|
+
mesh.append(None)
|
|
157
|
+
|
|
158
|
+
# convert the lists of points to data trees
|
|
159
|
+
points = list_to_data_tree(points)
|
|
160
|
+
vecs = list_to_data_tree(vecs)
|