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,90 @@
|
|
|
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 list of exterior subface (apertures + doors) modifiers that can be
|
|
12
|
+
used to edit or create a ModifierSet object.
|
|
13
|
+
-
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
_window_: A modifier object for apertures with an Outdoors boundary
|
|
17
|
+
condition and a Wall face type for their parent face. This can also
|
|
18
|
+
be text for the identifier of the modifier within the library.
|
|
19
|
+
_skylight_: A modifier object for apertures with an Outdoors boundary
|
|
20
|
+
condition and a RoofCeiling or Floor face type for their parent face.
|
|
21
|
+
This can also be text for the identifier of the modifier within
|
|
22
|
+
the library.
|
|
23
|
+
_operable_: A modifier object for apertures with an Outdoors boundary
|
|
24
|
+
condition and True is_operable property. This can also be text for
|
|
25
|
+
the identifier of the modifier within the library.
|
|
26
|
+
_exterior_door_: A modifier object for opaque doors with an Outdoors
|
|
27
|
+
boundary condition and a Wall face type for their parent face. This
|
|
28
|
+
can also be text for the identifier of the modifier within
|
|
29
|
+
the library.
|
|
30
|
+
_overhead_door_: A modifier object for opaque doors with an Outdoors
|
|
31
|
+
boundary condition and a RoofCeiling or Floor face type for their
|
|
32
|
+
parent face. This can also be text for the identifier of the modifier
|
|
33
|
+
within the library.
|
|
34
|
+
_glass_door_: A modifier object for all glass doors with an Outdoors
|
|
35
|
+
boundary condition. This can also be text for the identifier of the
|
|
36
|
+
modifier within the library.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
subface_set: A list of exterior subface modifiers that can be used
|
|
40
|
+
to edit or create a ModifierSet object.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
ghenv.Component.Name = 'HB Subface Modifier Subset'
|
|
44
|
+
ghenv.Component.NickName = 'SubfaceSubset'
|
|
45
|
+
ghenv.Component.Message = '1.9.0'
|
|
46
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
47
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
48
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '4'
|
|
49
|
+
|
|
50
|
+
try: # import honeybee_radiance dependencies
|
|
51
|
+
from honeybee_radiance.modifier import Modifier
|
|
52
|
+
from honeybee_radiance.lib.modifiers import modifier_by_identifier
|
|
53
|
+
except ImportError as e:
|
|
54
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
55
|
+
|
|
56
|
+
try:
|
|
57
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
58
|
+
except ImportError as e:
|
|
59
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
60
|
+
turn_off_old_tag(ghenv.Component)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def check_mod(mod, input_name):
|
|
64
|
+
"""Get an Modifier from the library if it's a string."""
|
|
65
|
+
if isinstance(mod, str):
|
|
66
|
+
return modifier_by_identifier(mod)
|
|
67
|
+
else:
|
|
68
|
+
assert isinstance(mod, Modifier), \
|
|
69
|
+
'Expected Modifier for {}. Got {}'.format(input_name, type(mod))
|
|
70
|
+
return mod
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# go through each input construction
|
|
74
|
+
if _window_ is not None:
|
|
75
|
+
_window_ = check_mod(_window_, '_window_')
|
|
76
|
+
if _skylight_ is not None:
|
|
77
|
+
_skylight_ = check_mod(_skylight_, '_skylight_')
|
|
78
|
+
if _operable_ is not None:
|
|
79
|
+
_operable_ = check_mod(_operable_, '_operable_')
|
|
80
|
+
if _exterior_door_ is not None:
|
|
81
|
+
_exterior_door_ = check_mod(_exterior_door_, '_exterior_door_')
|
|
82
|
+
if _overhead_door_ is not None:
|
|
83
|
+
_overhead_door_ = check_mod(_overhead_door_, '_overhead_door_')
|
|
84
|
+
if _glass_door_ is not None:
|
|
85
|
+
_glass_door_ = check_mod(_glass_door_, '_glass_door_')
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# return the final list from the component
|
|
89
|
+
subface_set = [_window_, _skylight_, _operable_, _exterior_door_,
|
|
90
|
+
_overhead_door_, _glass_door_]
|
|
@@ -0,0 +1,77 @@
|
|
|
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 translucent radiance modifier from reflectances and transmittances.
|
|
12
|
+
_
|
|
13
|
+
The sum of the reflectances and transmittances must be less than 1
|
|
14
|
+
and any energy not transmitted or reflected is assumed to be absorbed.
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
_name_: Text to set the name for the modifier and to be incorporated into
|
|
19
|
+
a unique modifier identifier.
|
|
20
|
+
_r_diff_ref: A number between 0 and 1 for the red diffuse reflectance.
|
|
21
|
+
_g_diff_ref: A number between 0 and 1 for the green diffuse reflectance.
|
|
22
|
+
_b_diff_ref: A number between 0 and 1 for the blue diffuse reflectance.
|
|
23
|
+
_diff_trans: A number between 0 and 1 for the transmitted diffuse component.
|
|
24
|
+
This is the fraction of transmitted light that is diffusely scattered.
|
|
25
|
+
_spec_trans_: A number between 0 and 1 for the transmitted specular component.
|
|
26
|
+
This is the fraction of transmitted light that is not diffusely
|
|
27
|
+
scattered but passes through like a beam. (Default: 0).
|
|
28
|
+
_spec_: A number between 0 and 1 for the fraction of specularity. Specularity
|
|
29
|
+
fractions greater than 0.1 are not common in non-metallic
|
|
30
|
+
materials. (Default: 0).
|
|
31
|
+
_rough_: Roughness is specified as the rms slope of surface facets. A value
|
|
32
|
+
of 0 corresponds to a perfectly smooth surface, and a value of 1 would be
|
|
33
|
+
a very rough surface. Roughness values greater than 0.2 are not very
|
|
34
|
+
realistic. (Default: 0).
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
modifier: A translucent modifier that can be assigned to a Honeybee geometry
|
|
38
|
+
or Modifier Sets.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
ghenv.Component.Name = 'HB Translucent Modifier 3'
|
|
42
|
+
ghenv.Component.NickName = 'TransMod3'
|
|
43
|
+
ghenv.Component.Message = '1.9.0'
|
|
44
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
45
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
46
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '0'
|
|
47
|
+
|
|
48
|
+
try: # import the core honeybee dependencies
|
|
49
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
50
|
+
except ImportError as e:
|
|
51
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
52
|
+
|
|
53
|
+
try: # import the honeybee-radiance dependencies
|
|
54
|
+
from honeybee_radiance.modifier.material import Trans
|
|
55
|
+
except ImportError as e:
|
|
56
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
57
|
+
|
|
58
|
+
try: # import ladybug_rhino dependencies
|
|
59
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
60
|
+
except ImportError as e:
|
|
61
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if all_required_inputs(ghenv.Component):
|
|
65
|
+
# set the default modifier properties
|
|
66
|
+
_spec_trans_ = 0.0 if _spec_trans_ is None else _spec_trans_
|
|
67
|
+
_spec_ = 0.0 if _spec_ is None else _spec_
|
|
68
|
+
_rough_ = 0.0 if _rough_ is None else _rough_
|
|
69
|
+
name = clean_and_id_rad_string('TransMaterial') if _name_ is None else \
|
|
70
|
+
clean_rad_string(_name_)
|
|
71
|
+
|
|
72
|
+
# create the modifier
|
|
73
|
+
modifier = Trans.from_reflected_specularity(
|
|
74
|
+
name, _r_diff_ref, _g_diff_ref, _b_diff_ref,
|
|
75
|
+
_spec_, _rough_, _diff_trans, _spec_trans_)
|
|
76
|
+
if _name_ is not None:
|
|
77
|
+
modifier.display_name = _name_
|
|
@@ -0,0 +1,77 @@
|
|
|
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 translucent radiance modifier from a reflectance and transmittance.
|
|
12
|
+
_
|
|
13
|
+
The sum of the reflectances and transmittances must be less than 1
|
|
14
|
+
and any energy not transmitted or reflected is assumed to be absorbed.
|
|
15
|
+
The resulting material will always be grey with equivalent red, green and
|
|
16
|
+
blue channels.
|
|
17
|
+
-
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
_name_: Text to set the name for the modifier and to be incorporated into
|
|
21
|
+
a unique modifier identifier.
|
|
22
|
+
_diff_ref: A number between 0 and 1 for the diffuse reflectance of the material.
|
|
23
|
+
_diff_trans: A number between 0 and 1 for the transmitted diffuse component.
|
|
24
|
+
This is the fraction of transmitted light that is diffusely scattered.
|
|
25
|
+
_spec_trans_: A number between 0 and 1 for the transmitted specular component.
|
|
26
|
+
This is the fraction of transmitted light that is not diffusely
|
|
27
|
+
scattered but passes through like a beam. (Default: 0).
|
|
28
|
+
_spec_: A number between 0 and 1 for the fraction of specularity. Specularity
|
|
29
|
+
fractions greater than 0.1 are not common in non-metallic
|
|
30
|
+
materials. (Default: 0).
|
|
31
|
+
_rough_: Roughness is specified as the rms slope of surface facets. A value
|
|
32
|
+
of 0 corresponds to a perfectly smooth surface, and a value of 1 would be
|
|
33
|
+
a very rough surface. Roughness values greater than 0.2 are not very
|
|
34
|
+
realistic. (Default: 0).
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
modifier: A translucent modifier that can be assigned to a Honeybee geometry
|
|
38
|
+
or Modifier Sets.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
ghenv.Component.Name = 'HB Translucent Modifier'
|
|
42
|
+
ghenv.Component.NickName = 'TransMod'
|
|
43
|
+
ghenv.Component.Message = '1.9.0'
|
|
44
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
45
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
46
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
47
|
+
|
|
48
|
+
try: # import the core honeybee dependencies
|
|
49
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
50
|
+
except ImportError as e:
|
|
51
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
52
|
+
|
|
53
|
+
try: # import the honeybee-radiance dependencies
|
|
54
|
+
from honeybee_radiance.modifier.material import Trans
|
|
55
|
+
except ImportError as e:
|
|
56
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
57
|
+
|
|
58
|
+
try: # import ladybug_rhino dependencies
|
|
59
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
60
|
+
except ImportError as e:
|
|
61
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if all_required_inputs(ghenv.Component):
|
|
65
|
+
# set the default modifier properties
|
|
66
|
+
_spec_trans_ = 0.0 if _spec_trans_ is None else _spec_trans_
|
|
67
|
+
_spec_ = 0.0 if _spec_ is None else _spec_
|
|
68
|
+
_rough_ = 0.0 if _rough_ is None else _rough_
|
|
69
|
+
name = clean_and_id_rad_string('TransMaterial') if _name_ is None else \
|
|
70
|
+
clean_rad_string(_name_)
|
|
71
|
+
|
|
72
|
+
# create the modifier
|
|
73
|
+
modifier = Trans.from_reflected_specularity(
|
|
74
|
+
name, _diff_ref, _diff_ref, _diff_ref,
|
|
75
|
+
_spec_, _rough_, _diff_trans, _spec_trans_)
|
|
76
|
+
if _name_ is not None:
|
|
77
|
+
modifier.display_name = _name_
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Honeybee View for an image-based analysis using a Rhino viewport.
|
|
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
|
+
_viewport_: The Rhino viewport name which will be used to generate a radiance
|
|
18
|
+
View object. Typical inputs include "Perspective", "Top", "Bottom",
|
|
19
|
+
"Left", "Right", "Front", "Back" or any viewport name that you have
|
|
20
|
+
saved within the Rhino file. If no text is input here, the default
|
|
21
|
+
will be the currently active viewport (the last viewport in which
|
|
22
|
+
you navigated).
|
|
23
|
+
_view_type_: An integer to set the view type (-vt). Choose from the choices
|
|
24
|
+
below. Default: 0 if the viewport is in perspective; 2 if it is parallel.
|
|
25
|
+
* 0 Perspective (v)
|
|
26
|
+
* 1 Hemispherical fisheye (h)
|
|
27
|
+
* 2 Parallel (l)
|
|
28
|
+
* 3 Cylindrical panorama (c)
|
|
29
|
+
* 4 Angular fisheye (a)
|
|
30
|
+
* 5 Planisphere [stereographic] projection (s)
|
|
31
|
+
For more detailed description about view types check rpict manual
|
|
32
|
+
page (http://radsite.lbl.gov/radiance/man_html/rpict.1.html)
|
|
33
|
+
refresh_: Connect a Grasshopper "button" component to refresh the orientation
|
|
34
|
+
upon hitting the button.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
view: A Honeybee View object that can be used in a view-based recipe.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
ghenv.Component.Name = 'HB View from Viewport'
|
|
41
|
+
ghenv.Component.NickName = 'Viewport'
|
|
42
|
+
ghenv.Component.Message = '1.9.0'
|
|
43
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
44
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
45
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '4'
|
|
46
|
+
|
|
47
|
+
try: # import the core honeybee dependencies
|
|
48
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
49
|
+
except ImportError as e:
|
|
50
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
from honeybee_radiance.view import View
|
|
54
|
+
except ImportError as e:
|
|
55
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
56
|
+
|
|
57
|
+
try: # import ladybug_rhino dependencies
|
|
58
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
59
|
+
from ladybug_rhino.viewport import viewport_by_name, viewport_properties
|
|
60
|
+
except ImportError as e:
|
|
61
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
62
|
+
turn_off_old_tag(ghenv.Component)
|
|
63
|
+
|
|
64
|
+
VIEW_TYPES = ('v', 'h', 'l', 'c', 'a', 's')
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
# set the default values
|
|
68
|
+
name = clean_and_id_rad_string('View') if _name_ is None else _name_
|
|
69
|
+
if _view_type_ is None:
|
|
70
|
+
_type_= 0
|
|
71
|
+
else:
|
|
72
|
+
_type_= VIEW_TYPES.index(_view_type_) if _view_type_ in VIEW_TYPES else int(_view_type_)
|
|
73
|
+
|
|
74
|
+
# process the Rhino viewport
|
|
75
|
+
viewp = viewport_by_name(_viewport_)
|
|
76
|
+
v_props = viewport_properties(viewp, _type_)
|
|
77
|
+
|
|
78
|
+
# create the view object
|
|
79
|
+
view = View(
|
|
80
|
+
clean_rad_string(name), v_props['position'], v_props['direction'],
|
|
81
|
+
v_props['up_vector'], VIEW_TYPES[v_props['view_type']],
|
|
82
|
+
v_props['h_angle'], v_props['v_angle'])
|
|
83
|
+
view.standardize_fisheye()
|
|
84
|
+
if _name_ is not None:
|
|
85
|
+
view.display_name = _name_
|
|
@@ -0,0 +1,96 @@
|
|
|
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 Honeybee View for an image-based analysis.
|
|
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
|
+
_position: An point to set the position of the view in 3D space (-vp).
|
|
18
|
+
This is the focal point of a perspective view or the center of a
|
|
19
|
+
parallel projection.
|
|
20
|
+
_direction: A vector for the direction that the veiw is facing (-vd).
|
|
21
|
+
The length of this vector indicates the focal distance as needed by
|
|
22
|
+
the pixel depth of field (-pd) in rpict.
|
|
23
|
+
_up_vector_: An optional vector to set the vertical direction of the
|
|
24
|
+
view (-vu). (Default: (0, 0, 1)).
|
|
25
|
+
_view_type_: An integer to set the view type (-vt). Choose from the choices
|
|
26
|
+
below. (Default: 0).
|
|
27
|
+
* 0 Perspective (v)
|
|
28
|
+
* 1 Hemispherical fisheye (h)
|
|
29
|
+
* 2 Parallel (l)
|
|
30
|
+
* 3 Cylindrical panorama (c)
|
|
31
|
+
* 4 Angular fisheye (a)
|
|
32
|
+
* 5 Planisphere [stereographic] projection (s)
|
|
33
|
+
For more detailed description about view types check rpict manual
|
|
34
|
+
page (http://radsite.lbl.gov/radiance/man_html/rpict.1.html)
|
|
35
|
+
_h_angle_: A number for the view horizontal size (-vh) in degrees. For a
|
|
36
|
+
perspective projection (including fisheye views), val is the horizontal
|
|
37
|
+
field of view. For a parallel projection, val is the view width in
|
|
38
|
+
world coordinates. (Default: 60).
|
|
39
|
+
_v_angle_: A number for the view vertical size (-vv) in degrees. For
|
|
40
|
+
a perspective projection (including fisheye views), val is the horizontal
|
|
41
|
+
field of view. For a parallel projection, val is the view width in
|
|
42
|
+
world coordinates. (Default: 60).
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
view: A Honeybee View object that can be used in an view-based recipe.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
ghenv.Component.Name = 'HB View'
|
|
49
|
+
ghenv.Component.NickName = 'View'
|
|
50
|
+
ghenv.Component.Message = '1.9.0'
|
|
51
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
52
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
53
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '4'
|
|
54
|
+
|
|
55
|
+
try: # import the core honeybee dependencies
|
|
56
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
57
|
+
except ImportError as e:
|
|
58
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
59
|
+
|
|
60
|
+
try:
|
|
61
|
+
from honeybee_radiance.view import View
|
|
62
|
+
except ImportError as e:
|
|
63
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
64
|
+
|
|
65
|
+
try: # import ladybug_rhino dependencies
|
|
66
|
+
from ladybug_rhino.togeometry import to_point3d, to_vector3d
|
|
67
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
68
|
+
except ImportError as e:
|
|
69
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
70
|
+
|
|
71
|
+
VIEW_TYPES = ('v', 'h', 'l', 'c', 'a', 's')
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
if all_required_inputs(ghenv.Component):
|
|
75
|
+
# process the points/vectors into tuples
|
|
76
|
+
posit = to_point3d(_position)
|
|
77
|
+
direct = to_vector3d(_direction)
|
|
78
|
+
_pos = (posit.x, posit.y, posit.z)
|
|
79
|
+
_dir = (direct.x, direct.y, direct.z)
|
|
80
|
+
|
|
81
|
+
# set the default values
|
|
82
|
+
name = clean_and_id_rad_string('View') if _name_ is None else _name_
|
|
83
|
+
_up_vec = (_up_vector_.X, _up_vector_.Y, _up_vector_.Z) if _up_vector_ \
|
|
84
|
+
is not None else (0, 0, 1)
|
|
85
|
+
if _view_type_ is None:
|
|
86
|
+
_type_= 'v'
|
|
87
|
+
else:
|
|
88
|
+
_type_= _view_type_ if _view_type_ in VIEW_TYPES else VIEW_TYPES[int(_view_type_)]
|
|
89
|
+
_h_angle_ = 60 if _h_angle_ is None else _h_angle_
|
|
90
|
+
_v_angle_ = 60 if _v_angle_ is None else _v_angle_
|
|
91
|
+
|
|
92
|
+
view = View(clean_rad_string(name), _pos, _dir, _up_vec, _type_,
|
|
93
|
+
_h_angle_, _v_angle_)
|
|
94
|
+
view.standardize_fisheye()
|
|
95
|
+
if _name_ is not None:
|
|
96
|
+
view.display_name = _name_
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# This file is part of Honeybee.
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
4
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
5
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
6
|
+
#
|
|
7
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
Visualize a sky as a High Dynamic Range (HDR) image file.
|
|
11
|
+
-
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
_sky: A Radiance sky from any of the sky components under the "Light Sources" tab.
|
|
15
|
+
Text string representations of skies are also acceptable.
|
|
16
|
+
_size_: A number for the X and Y dimension of the imgae in pixles. (Default: 500 px)
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
hdr: Path to the High Dynamic Range (HDR) image file of the sky. This can be
|
|
20
|
+
plugged into the Ladybug "Image Viewer" component to preview the image.
|
|
21
|
+
It can also be plugged into the "HB False Color" component to convert
|
|
22
|
+
the image into a false color version. Lastly, it can be connected to
|
|
23
|
+
the "HB HDR to GIF" component to get a GIF image that is more portable
|
|
24
|
+
and easily previewed by different software.
|
|
25
|
+
ghi: The global horizontal irradiance (W/m2) for an upstructed test point under
|
|
26
|
+
the sky.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
ghenv.Component.Name = 'HB Visualize Sky'
|
|
30
|
+
ghenv.Component.NickName = 'VizSky'
|
|
31
|
+
ghenv.Component.Message = '1.9.0'
|
|
32
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
33
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
34
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '3'
|
|
35
|
+
|
|
36
|
+
import os
|
|
37
|
+
|
|
38
|
+
try: # import honeybee_radiance dependencies
|
|
39
|
+
from ladybug.futil import write_to_file_by_name
|
|
40
|
+
except ImportError as e:
|
|
41
|
+
raise ImportError('\nFailed to import ladybug:\n\t{}'.format(e))
|
|
42
|
+
|
|
43
|
+
try: # import honeybee dependencies
|
|
44
|
+
from honeybee.config import folders
|
|
45
|
+
from honeybee.typing import clean_rad_string
|
|
46
|
+
except ImportError as e:
|
|
47
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
48
|
+
|
|
49
|
+
try: # import honeybee_radiance_command dependencies
|
|
50
|
+
from honeybee_radiance_command.oconv import Oconv
|
|
51
|
+
from honeybee_radiance_command.rpict import Rpict
|
|
52
|
+
from honeybee_radiance_command.rtrace import Rtrace
|
|
53
|
+
from honeybee_radiance_command.rcalc import Rcalc
|
|
54
|
+
from honeybee_radiance_command.pcond import Pcond
|
|
55
|
+
from honeybee_radiance_command.pflip import Pflip
|
|
56
|
+
except ImportError as e:
|
|
57
|
+
raise ImportError('\nFailed to import honeybee_radiance_command:\n\t{}'.format(e))
|
|
58
|
+
|
|
59
|
+
try: # import honeybee_radiance dependencies
|
|
60
|
+
from honeybee_radiance.config import folders as rad_folders
|
|
61
|
+
from honeybee_radiance.lightsource.sky.strutil import string_to_sky
|
|
62
|
+
from honeybee_radiance.lightsource.sky import ClimateBased
|
|
63
|
+
from honeybee_radiance.sensorgrid import SensorGrid
|
|
64
|
+
except ImportError as e:
|
|
65
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
66
|
+
|
|
67
|
+
try: # import ladybug_rhino dependencies
|
|
68
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
69
|
+
except ImportError as e:
|
|
70
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
71
|
+
|
|
72
|
+
# check the Radiance date of the installed radiance
|
|
73
|
+
try: # import lbt_recipes dependencies
|
|
74
|
+
from lbt_recipes.version import check_radiance_date
|
|
75
|
+
except ImportError as e:
|
|
76
|
+
raise ImportError('\nFailed to import lbt_recipes:\n\t{}'.format(e))
|
|
77
|
+
check_radiance_date()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if all_required_inputs(ghenv.Component):
|
|
81
|
+
# set defaults and process the sky input
|
|
82
|
+
_size_ = 500 if _size_ is None else _size_
|
|
83
|
+
if isinstance(_sky, str): # convert the sky string into a sky object
|
|
84
|
+
_sky = string_to_sky(_sky)
|
|
85
|
+
sky_content = _sky.to_radiance(1) if isinstance(_sky, ClimateBased) else _sky.to_radiance()
|
|
86
|
+
|
|
87
|
+
# set up the paths for the various files used in translation
|
|
88
|
+
sky_dir = os.path.join(folders.default_simulation_folder, 'sky_visualiztion')
|
|
89
|
+
sky_file, sky_oct = 'weather.sky', 'sky_visual.oct'
|
|
90
|
+
write_to_file_by_name(sky_dir, sky_file, sky_content, mkdir=True)
|
|
91
|
+
ghi_res, full_ghi_res = 'ghi.res', os.path.join(sky_dir, 'ghi.res')
|
|
92
|
+
init_hdr, final_hdr = 'sky_init.HDR', '{}.HDR'.format(clean_rad_string(str(_sky)))
|
|
93
|
+
hdr = os.path.join(sky_dir, final_hdr)
|
|
94
|
+
if os.path.isfile(hdr):
|
|
95
|
+
os.remove(hdr)
|
|
96
|
+
|
|
97
|
+
# build up the commands to render the image of the sky
|
|
98
|
+
oconv = Oconv(inputs=[sky_file], output=sky_oct)
|
|
99
|
+
oconv.options.f = True
|
|
100
|
+
|
|
101
|
+
rpict = Rpict(octree=sky_oct, output=init_hdr)
|
|
102
|
+
rpict.options.i = True
|
|
103
|
+
rpict.options.t = 10
|
|
104
|
+
rpict.options.ab = 1
|
|
105
|
+
rpict.options.ad = 1000
|
|
106
|
+
rpict.options.as_ = 20
|
|
107
|
+
rpict.options.ar = 300
|
|
108
|
+
rpict.options.aa = 0.1
|
|
109
|
+
rpict.options.x = _size_
|
|
110
|
+
rpict.options.y = _size_
|
|
111
|
+
rpict.options.vt = 'h'
|
|
112
|
+
rpict.options.vp = (0, 0, 0)
|
|
113
|
+
rpict.options.vd = (0, 0, 1)
|
|
114
|
+
rpict.options.vu = (0, 1, 0)
|
|
115
|
+
rpict.options.vh = 180
|
|
116
|
+
rpict.options.vv = 180
|
|
117
|
+
|
|
118
|
+
pflip = Pflip(input=init_hdr, output=final_hdr)
|
|
119
|
+
pflip.options.h = True
|
|
120
|
+
|
|
121
|
+
# add the command to get the horizontal irradiance of the sky
|
|
122
|
+
grid = SensorGrid.from_position_and_direction('up_sensor', [(0, 0, 0)], [(0, 0, 1)])
|
|
123
|
+
grid.to_file(sky_dir, 'up_sensor.pts')
|
|
124
|
+
rtrace = Rtrace(octree=sky_oct, sensors='up_sensor.pts')
|
|
125
|
+
rtrace.options.I = True
|
|
126
|
+
rtrace.options.w = True
|
|
127
|
+
rtrace.options.h = True
|
|
128
|
+
rtrace.options.ab = 1
|
|
129
|
+
rcalc = Rcalc(output=ghi_res)
|
|
130
|
+
rcalc.options.e = '$1=(0.265*$1+0.67*$2+0.065*$3)'
|
|
131
|
+
rtrace.pipe_to = rcalc
|
|
132
|
+
|
|
133
|
+
# run the commands in series and load the global horizontal irradiance
|
|
134
|
+
env = None
|
|
135
|
+
if rad_folders.env != {}:
|
|
136
|
+
env = rad_folders.env
|
|
137
|
+
env = dict(os.environ, **env) if env else None
|
|
138
|
+
for r_cmd in (oconv, rpict, pflip, rtrace):
|
|
139
|
+
r_cmd.run(env, cwd=sky_dir)
|
|
140
|
+
with open(full_ghi_res, 'r') as inf:
|
|
141
|
+
ghi = inf.readlines()[0].strip()
|
|
@@ -0,0 +1,61 @@
|
|
|
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 WEA object using the original ASHRAE Clear Sky formula.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
_location: A Ladybug Location object which will set the sun poisition for
|
|
16
|
+
the clear sky Wea. Locations can be obtained from the "LB Import
|
|
17
|
+
EPW" or the "LB Construct Location" component.
|
|
18
|
+
clearness_: A factor to be multiplied by the output of the clear sky model.
|
|
19
|
+
This is to help account for locations where clear, dry skies predominate
|
|
20
|
+
(e.g., at high elevations) or, conversely, where hazy and humid conditions
|
|
21
|
+
are frequent. See Threlkeld and Jordan (1958) for recommended values.
|
|
22
|
+
Typical values range from 0.95 to 1.05 and are usually never more
|
|
23
|
+
than 1.2. (Default: 1.0).
|
|
24
|
+
hoys_: An optional list of hours of the year (numbers from 0 to 8759) for
|
|
25
|
+
which the Wea will be filtered. HOYs can be generated from the
|
|
26
|
+
"LB Analysis Period" component or they can be obtained through
|
|
27
|
+
other means like analysis of the values in an occupancy schedule.
|
|
28
|
+
By default, the Wea will be generated for the whole year.
|
|
29
|
+
timestep_: An integer representing the timestep with which to make the
|
|
30
|
+
WEA object. (Default: 1, for 1 step per hour of the year).
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
wea: A wea object from stat file. This wea object represents an original
|
|
34
|
+
ASHRAE Clear Sky, which is intended to determine peak solar load and
|
|
35
|
+
sizing parmeters for HVAC systems.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
ghenv.Component.Name = 'HB Wea From Clear Sky'
|
|
39
|
+
ghenv.Component.NickName = 'ClearSky'
|
|
40
|
+
ghenv.Component.Message = '1.9.0'
|
|
41
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
42
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
43
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
44
|
+
|
|
45
|
+
try:
|
|
46
|
+
from ladybug.wea import Wea
|
|
47
|
+
except ImportError as e:
|
|
48
|
+
raise ImportError('\nFailed to import honeybee:\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
|
+
timestep_ = 1 if timestep_ is None else timestep_
|
|
58
|
+
clearness_ = 1 if clearness_ is None else clearness_
|
|
59
|
+
wea = Wea.from_ashrae_clear_sky(_location, clearness_, timestep_)
|
|
60
|
+
if len(hoys_) != 0:
|
|
61
|
+
wea = wea.filter_by_hoys(hoys_)
|
|
@@ -0,0 +1,50 @@
|
|
|
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 Wea object from an EPW file.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
_epw_file: Full path to an .epw weather file.
|
|
16
|
+
hoys_: An optional list of hours of the year (numbers from 0 to 8759) for
|
|
17
|
+
which the Wea will be filtered. HOYs can be generated from the
|
|
18
|
+
"LB Analysis Period" component or they can be obtained through
|
|
19
|
+
other means like analysis of the values in an occupancy schedule.
|
|
20
|
+
By default, the Wea will be generated for the whole year.
|
|
21
|
+
timestep_: An integer representing the timestep with which to make the
|
|
22
|
+
WEA object. Default is set to 1 for 1 step per hour of the year.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
wea: A wea object from epw file.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
ghenv.Component.Name = 'HB Wea From EPW'
|
|
29
|
+
ghenv.Component.NickName = 'Wea'
|
|
30
|
+
ghenv.Component.Message = '1.9.0'
|
|
31
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
32
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
33
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '2'
|
|
34
|
+
|
|
35
|
+
try:
|
|
36
|
+
from ladybug.wea import Wea
|
|
37
|
+
except ImportError as e:
|
|
38
|
+
raise ImportError('\nFailed to import ladybug:\n\t{}'.format(e))
|
|
39
|
+
|
|
40
|
+
try: # import ladybug_rhino dependencies
|
|
41
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
42
|
+
except ImportError as e:
|
|
43
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if all_required_inputs(ghenv.Component):
|
|
47
|
+
timestep_ = 1 if timestep_ is None else timestep_
|
|
48
|
+
wea = Wea.from_epw_file(_epw_file, timestep_)
|
|
49
|
+
if len(hoys_) != 0:
|
|
50
|
+
wea = wea.filter_by_hoys(hoys_)
|