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,99 @@
|
|
|
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 Sensor Grid object from radial directions around sensor positions.
|
|
12
|
+
_
|
|
13
|
+
This type of sensor grid is particularly helpful for studies of multiple view
|
|
14
|
+
directions, such as imageless glare studies.
|
|
15
|
+
-
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
_name_: A name for this sensor grid.
|
|
19
|
+
_positions: A list or a datatree of points with one point for the position
|
|
20
|
+
of each radial sensor. Each branch of the datatree will be
|
|
21
|
+
considered as a separate sensor grid.
|
|
22
|
+
_dir_count_: A positive integer for the number of radial directions to be
|
|
23
|
+
generated around each position. (Default: 8).
|
|
24
|
+
_start_vec_: A Vector3D to set the start direction of the generated directions.
|
|
25
|
+
This can be used to orient the resulting sensors to specific parts
|
|
26
|
+
of the scene. It can also change the elevation of the resulting
|
|
27
|
+
directions since this start vector will always be rotated in the
|
|
28
|
+
XY plane to generate the resulting directions. (Default: (0, -1, 0)).
|
|
29
|
+
mesh_radius_: An optional number that can be used to generate a mesh that is
|
|
30
|
+
aligned with the resulting sensors and will automatically be
|
|
31
|
+
assigned to the grid. Such meshes will resemble a circle around
|
|
32
|
+
each sensor with the specified radius and will contain triangular
|
|
33
|
+
faces that can be colored with simulation results. If zero, no mesh
|
|
34
|
+
will be generated for the sensor grid. (Default: 0.2 meters).
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
grid: An SensorGrid object that can be used in a grid-based recipe.
|
|
38
|
+
mesh: Analysis mesh that can be passed to the 'Spatial Heatmap' component.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
ghenv.Component.Name = 'HB Radial Sensor Grid'
|
|
42
|
+
ghenv.Component.NickName = 'SensorGrid'
|
|
43
|
+
ghenv.Component.Message = '1.9.0'
|
|
44
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
45
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
46
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '0'
|
|
47
|
+
|
|
48
|
+
try: # import the ladybug_geometry dependencies
|
|
49
|
+
from ladybug_geometry.geometry3d.pointvector import Vector3D, Point3D
|
|
50
|
+
except ImportError as e:
|
|
51
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
52
|
+
|
|
53
|
+
try: # import the core honeybee dependencies
|
|
54
|
+
from honeybee.typing import clean_and_id_rad_string, clean_rad_string
|
|
55
|
+
except ImportError as e:
|
|
56
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
57
|
+
|
|
58
|
+
try: # import the honeybee-radiance dependencies
|
|
59
|
+
from honeybee_radiance.sensorgrid import SensorGrid
|
|
60
|
+
except ImportError as e:
|
|
61
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
62
|
+
|
|
63
|
+
try: # import ladybug_rhino dependencies
|
|
64
|
+
from ladybug_rhino.config import conversion_to_meters
|
|
65
|
+
from ladybug_rhino.togeometry import to_vector3d
|
|
66
|
+
from ladybug_rhino.fromgeometry import from_mesh3d, from_point3d, from_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
|
+
|
|
72
|
+
if all_required_inputs(ghenv.Component):
|
|
73
|
+
# set the default name and process the points to tuples
|
|
74
|
+
name = clean_and_id_rad_string('SensorGrid') if _name_ is None else _name_
|
|
75
|
+
pts = [(pt.X, pt.Y, pt.Z) for pt in _positions]
|
|
76
|
+
dir_count = 8 if _dir_count_ is None else _dir_count_
|
|
77
|
+
mesh_radius = 0.2 / conversion_to_meters() if mesh_radius_ is None else mesh_radius_
|
|
78
|
+
try:
|
|
79
|
+
st_vec = to_vector3d(_start_vec_)
|
|
80
|
+
except AttributeError:
|
|
81
|
+
st_vec = Vector3D(0, -1, 0)
|
|
82
|
+
|
|
83
|
+
# create the sensor grid object
|
|
84
|
+
id = clean_rad_string(name) if '/' not in name else clean_rad_string(name.split('/')[0])
|
|
85
|
+
grid = SensorGrid.from_positions_radial(
|
|
86
|
+
id, pts, dir_count, start_vector=st_vec, mesh_radius=mesh_radius)
|
|
87
|
+
|
|
88
|
+
# set the display name and get outputs
|
|
89
|
+
if _name_ is not None:
|
|
90
|
+
grid.display_name = _name_
|
|
91
|
+
if '/' in name:
|
|
92
|
+
grid.group_identifier = \
|
|
93
|
+
'/'.join(clean_rad_string(key) for key in name.split('/')[1:])
|
|
94
|
+
sensors = grid.sensors
|
|
95
|
+
points = [from_point3d(Point3D(*sen.pos)) for sen in sensors]
|
|
96
|
+
vecs = [from_vector3d(Vector3D(*sen.dir)) for sen in sensors]
|
|
97
|
+
lb_mesh = grid.mesh
|
|
98
|
+
if lb_mesh is not None:
|
|
99
|
+
mesh = from_mesh3d(lb_mesh)
|
|
@@ -0,0 +1,163 @@
|
|
|
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
|
+
Get recommended Radiance parameters given a recipe type and a level of detail.
|
|
12
|
+
_
|
|
13
|
+
The original recommendation for the various Radiance paramters comes from this document.
|
|
14
|
+
http://radsite.lbl.gov/radiance/refer/Notes/rpict_options.html
|
|
15
|
+
_
|
|
16
|
+
This presentation by John Mardaljevic gives a good overview of the meaning of each
|
|
17
|
+
radiance paramter.
|
|
18
|
+
http://radiance-online.org/community/workshops/2011-berkeley-ca/presentations/day1/JM_AmbientCalculation.pdf
|
|
19
|
+
|
|
20
|
+
-
|
|
21
|
+
Args:
|
|
22
|
+
_recipe_type: An integer or text for the type of recipe. Acceptable text inputs are
|
|
23
|
+
either the full text of the recipe type (eg. point-in-time-grid) or
|
|
24
|
+
the name of the Radiance command for which the parameters are being
|
|
25
|
+
used (eg. rtrace). Choose from the following options.
|
|
26
|
+
* 0 | rtrace | point-in-time-grid | daylight-factor
|
|
27
|
+
* 1 | rpict | point-in-time-view
|
|
28
|
+
* 2 | rfluxmtx | annual
|
|
29
|
+
_detail_level_: An integer or text for the level of detail/quality for which
|
|
30
|
+
radiance parameters will be output. (Default: 0 for low).
|
|
31
|
+
Choose from the following options.
|
|
32
|
+
* 0 | low
|
|
33
|
+
* 1 | medium
|
|
34
|
+
* 2 | high
|
|
35
|
+
additional_par_: Text to override the Radiance parameters as needed. Radiance's
|
|
36
|
+
standard syntax must be followed (e.g. -ps 1 -lw 0.01).
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
rad_par: Radiance parameters as a text string. These can be plugged into the
|
|
40
|
+
radiance_par_ input of the various recipes.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
ghenv.Component.Name = 'HB Radiance Parameter'
|
|
44
|
+
ghenv.Component.NickName = 'RadPar'
|
|
45
|
+
ghenv.Component.Message = '1.9.0'
|
|
46
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
47
|
+
ghenv.Component.SubCategory = '3 :: Recipes'
|
|
48
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '6'
|
|
49
|
+
|
|
50
|
+
try: # import honeybee_radiance_command dependencies
|
|
51
|
+
from honeybee_radiance_command.options.rtrace import RtraceOptions
|
|
52
|
+
from honeybee_radiance_command.options.rpict import RpictOptions
|
|
53
|
+
from honeybee_radiance_command.options.rfluxmtx import RfluxmtxOptions
|
|
54
|
+
except ImportError as e:
|
|
55
|
+
raise ImportError('\nFailed to import honeybee_radiance_command:\n\t{}'.format(e))
|
|
56
|
+
|
|
57
|
+
try:
|
|
58
|
+
from ladybug_rhino.grasshopper import all_required_inputs, recipe_result
|
|
59
|
+
except ImportError as e:
|
|
60
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
61
|
+
|
|
62
|
+
# dictionaries of the various recommendations for radiance parameters
|
|
63
|
+
RTRACE = {
|
|
64
|
+
'ab': [2, 3, 6],
|
|
65
|
+
'ad': [512, 2048, 4096],
|
|
66
|
+
'as_': [128, 2048, 4096],
|
|
67
|
+
'ar': [16, 64, 128],
|
|
68
|
+
'aa': [.25, .2, .1],
|
|
69
|
+
'dj': [0, .5, 1],
|
|
70
|
+
'ds': [.5, .25, .05],
|
|
71
|
+
'dt': [.5, .25, .15],
|
|
72
|
+
'dc': [.25, .5, .75],
|
|
73
|
+
'dr': [0, 1, 3],
|
|
74
|
+
'dp': [64, 256, 512],
|
|
75
|
+
'st': [.85, .5, .15],
|
|
76
|
+
'lr': [4, 6, 8],
|
|
77
|
+
'lw': [.05, .01, .005],
|
|
78
|
+
'ss': [0, .7, 1]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
RPICT = {
|
|
82
|
+
'ab': [2, 3, 6],
|
|
83
|
+
'ad': [512, 2048, 4096],
|
|
84
|
+
'as_': [128, 2048, 4096],
|
|
85
|
+
'ar': [16, 64, 128],
|
|
86
|
+
'aa': [.25, .2, .1],
|
|
87
|
+
'ps': [8, 4, 2],
|
|
88
|
+
'pt': [.15, .10, .05],
|
|
89
|
+
'pj': [.6, .9, .9],
|
|
90
|
+
'dj': [0, .5, 1],
|
|
91
|
+
'ds': [.5, .25, .05],
|
|
92
|
+
'dt': [.5, .25, .15],
|
|
93
|
+
'dc': [.25, .5, .75],
|
|
94
|
+
'dr': [0, 1, 3],
|
|
95
|
+
'dp': [64, 256, 512],
|
|
96
|
+
'st': [.85, .5, .15],
|
|
97
|
+
'lr': [4, 6, 8],
|
|
98
|
+
'lw': [.05, .01, .005],
|
|
99
|
+
'ss': [0, .7, 1]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
RFLUXMTX = {
|
|
103
|
+
'ab': [3, 5, 6],
|
|
104
|
+
'ad': [5000, 15000, 25000],
|
|
105
|
+
'as_': [128, 2048, 4096],
|
|
106
|
+
'ds': [.5, .25, .05],
|
|
107
|
+
'dt': [.5, .25, .15],
|
|
108
|
+
'dc': [.25, .5, .75],
|
|
109
|
+
'dr': [0, 1, 3],
|
|
110
|
+
'dp': [64, 256, 512],
|
|
111
|
+
'st': [.85, .5, .15],
|
|
112
|
+
'lr': [4, 6, 8],
|
|
113
|
+
'lw': [0.000002, 6.67E-07, 4E-07],
|
|
114
|
+
'ss': [0, .7, 1],
|
|
115
|
+
'c': [1, 1, 1]
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# dictionaries to convert between input formats
|
|
120
|
+
RECIPE_TYPES = {
|
|
121
|
+
'0': 'rtrace',
|
|
122
|
+
'point-in-time-grid': 'rtrace',
|
|
123
|
+
'daylight-factor': 'rtrace',
|
|
124
|
+
'rtrace': 'rtrace',
|
|
125
|
+
'1': 'rpict',
|
|
126
|
+
'point-in-time-image': 'rpict',
|
|
127
|
+
'rpict': 'rpict',
|
|
128
|
+
'2': 'rfluxmtx',
|
|
129
|
+
'annual': 'rfluxmtx',
|
|
130
|
+
'rfluxmtx': 'rfluxmtx',
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
DETAIL_LEVELS = {
|
|
134
|
+
'0': 0,
|
|
135
|
+
'low': 0,
|
|
136
|
+
'1': 1,
|
|
137
|
+
'medium': 1,
|
|
138
|
+
'2': 2,
|
|
139
|
+
'high': 2
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
if all_required_inputs(ghenv.Component):
|
|
144
|
+
# process the recipe type and level of detail
|
|
145
|
+
_detail_level_ = DETAIL_LEVELS[_detail_level_.lower()] \
|
|
146
|
+
if _detail_level_ is not None else 0
|
|
147
|
+
command_name = RECIPE_TYPES[_recipe_type.lower()]
|
|
148
|
+
if command_name == 'rtrace':
|
|
149
|
+
option_dict = RTRACE
|
|
150
|
+
option_obj = RtraceOptions()
|
|
151
|
+
elif command_name == 'rpict':
|
|
152
|
+
option_dict = RPICT
|
|
153
|
+
option_obj = RpictOptions()
|
|
154
|
+
elif command_name == 'rfluxmtx':
|
|
155
|
+
option_dict = RFLUXMTX
|
|
156
|
+
option_obj = RfluxmtxOptions()
|
|
157
|
+
|
|
158
|
+
# assign the defualts to the object and output the string
|
|
159
|
+
for opt_name, opt_val in option_dict.items():
|
|
160
|
+
setattr(option_obj, opt_name, opt_val[_detail_level_])
|
|
161
|
+
if additional_par_:
|
|
162
|
+
option_obj.update_from_string(additional_par_)
|
|
163
|
+
rad_par = option_obj.to_radiance()
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
Search for available Mofidier Sets within the honeybee standards library.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
keywords_: Optional keywords to be used to narrow down the output list of
|
|
16
|
+
modifier sets. If nothing is input here, all available modifier sets
|
|
17
|
+
will be output.
|
|
18
|
+
join_words_: If False or None, this component will automatically split
|
|
19
|
+
any strings of multiple keywords (spearated by spaces) into separate
|
|
20
|
+
keywords for searching. This results in a greater liklihood of
|
|
21
|
+
finding an item in the search but it may not be appropropriate for
|
|
22
|
+
all cases. You may want to set it to True when you are searching for
|
|
23
|
+
a specific phrase that includes spaces. Default: False.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
mod_sets: A list of modifier sets within the honeybee radiance
|
|
27
|
+
standards library (filtered by keywords_ if they are input).
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
ghenv.Component.Name = 'HB Search Modifier Sets'
|
|
31
|
+
ghenv.Component.NickName = 'SearchModSets'
|
|
32
|
+
ghenv.Component.Message = '1.9.0'
|
|
33
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
34
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
35
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
36
|
+
|
|
37
|
+
try: # import the honeybee-core dependencies
|
|
38
|
+
from honeybee.search import filter_array_by_keywords
|
|
39
|
+
except ImportError as e:
|
|
40
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
41
|
+
|
|
42
|
+
try: # import the honeybee-radiance dependencies
|
|
43
|
+
from honeybee_radiance.lib.modifiersets import MODIFIER_SETS
|
|
44
|
+
except ImportError as e:
|
|
45
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
49
|
+
except ImportError as e:
|
|
50
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
51
|
+
turn_off_old_tag(ghenv.Component)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if len(keywords_) == 0:
|
|
55
|
+
mod_sets = sorted(MODIFIER_SETS)
|
|
56
|
+
else:
|
|
57
|
+
split_words = True if join_words_ is None else not join_words_
|
|
58
|
+
mod_sets = sorted(filter_array_by_keywords(MODIFIER_SETS, keywords_, split_words))
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
Search for available Mofidiers within the honeybee standards library.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
keywords_: Optional keywords to be used to narrow down the output list of
|
|
16
|
+
modifiers. If nothing is input here, all available modifiers
|
|
17
|
+
will be output.
|
|
18
|
+
join_words_: If False or None, this component will automatically split
|
|
19
|
+
any strings of multiple keywords (spearated by spaces) into separate
|
|
20
|
+
keywords for searching. This results in a greater liklihood of
|
|
21
|
+
finding an item in the search but it may not be appropropriate for
|
|
22
|
+
all cases. You may want to set it to True when you are searching for
|
|
23
|
+
a specific phrase that includes spaces. Default: False.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
modifiers: A list of modifiers within the honeybee radiance
|
|
27
|
+
standards library (filtered by keywords_ if they are input).
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
ghenv.Component.Name = 'HB Search Modifiers'
|
|
31
|
+
ghenv.Component.NickName = 'SearchMods'
|
|
32
|
+
ghenv.Component.Message = '1.9.0'
|
|
33
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
34
|
+
ghenv.Component.SubCategory = '1 :: Modifiers'
|
|
35
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
36
|
+
|
|
37
|
+
try: # import the honeybee-core dependencies
|
|
38
|
+
from honeybee.search import filter_array_by_keywords
|
|
39
|
+
except ImportError as e:
|
|
40
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
41
|
+
|
|
42
|
+
try: # import the honeybee-radiance dependencies
|
|
43
|
+
from honeybee_radiance.lib.modifiers import MODIFIERS
|
|
44
|
+
except ImportError as e:
|
|
45
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
49
|
+
except ImportError as e:
|
|
50
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
51
|
+
turn_off_old_tag(ghenv.Component)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if len(keywords_) == 0:
|
|
55
|
+
modifiers = sorted(MODIFIERS)
|
|
56
|
+
else:
|
|
57
|
+
split_words = True if join_words_ is None else not join_words_
|
|
58
|
+
modifiers = sorted(filter_array_by_keywords(MODIFIERS, keywords_, split_words))
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
Apply a section plane to a Honeybee Radiance View.
|
|
12
|
+
_
|
|
13
|
+
The plane will always be perpendicular to the view direction for perspective
|
|
14
|
+
and parallel view types. For fisheye view types, the clipping plane is actually
|
|
15
|
+
a clipping sphere, centered on the view point.
|
|
16
|
+
_
|
|
17
|
+
Objects in front of this imaginary plane will not be visible. This may be useful
|
|
18
|
+
for seeing through walls (to get a longer perspective from an exterior view point)
|
|
19
|
+
or for incremental rendering.
|
|
20
|
+
-
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
_view: A Honeybee Radiance View object to which a section plane should be applied.
|
|
24
|
+
_origin: An point to set the origin of the section plane in 3D space. Note
|
|
25
|
+
that the section plane is always perpenicular to the view direction
|
|
26
|
+
for perspective and parallel views.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
view: A Honeybee View object that can be used in a view-based recipe.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
ghenv.Component.Name = 'HB Section Plane View'
|
|
33
|
+
ghenv.Component.NickName = 'SectionView'
|
|
34
|
+
ghenv.Component.Message = '1.9.0'
|
|
35
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
36
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
37
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '0'
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
from ladybug_geometry.geometry3d.pointvector import Point3D
|
|
41
|
+
except ImportError as e:
|
|
42
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
from honeybee_radiance.view import View
|
|
46
|
+
except ImportError as e:
|
|
47
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
48
|
+
|
|
49
|
+
try: # import ladybug_rhino dependencies
|
|
50
|
+
from ladybug_rhino.togeometry import to_point3d
|
|
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
|
+
# process the input view and origin
|
|
58
|
+
if isinstance(_view, str):
|
|
59
|
+
view = View.from_string(_view)
|
|
60
|
+
else:
|
|
61
|
+
assert isinstance(_view, View), \
|
|
62
|
+
'Expected Honeybee View. Got {}.'.format(type(_view))
|
|
63
|
+
view = _view.duplicate()
|
|
64
|
+
view_pt = Point3D(*_view.position)
|
|
65
|
+
origin = to_point3d(_origin)
|
|
66
|
+
|
|
67
|
+
# set the fore clip according to the distance
|
|
68
|
+
view.fore_clip = origin.distance_to_point(view_pt)
|
|
69
|
+
#view.position = (origin.x, origin.y, origin.z)
|
|
@@ -0,0 +1,153 @@
|
|
|
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 SensorGrid objects from exterior Apertures.
|
|
12
|
+
_
|
|
13
|
+
These SensorGrids can be used in any grid-based recipe and are particularly useful
|
|
14
|
+
for irradiance studies that evaluate solar gain of buildings, such as peak solar
|
|
15
|
+
irradiance studies.
|
|
16
|
+
-
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
_hb_objs: A list of honeybee Faces or Rooms for which sensor grids will be
|
|
20
|
+
generated. This can also be an entire Honeybee Model.
|
|
21
|
+
_grid_size: Number for the size of the grid cells.
|
|
22
|
+
_offset_: Number for the distance to move points from the base geometry.
|
|
23
|
+
Positive numbers indicate an offset towards the exterior while
|
|
24
|
+
negative numbers indicate an offset towards the interior, essentially
|
|
25
|
+
modeling the value of trasnmitted sun through the glass. The default
|
|
26
|
+
is 0.1 meters.
|
|
27
|
+
_ap_type_: Text or an integer to specify the type of aperture that will be used to
|
|
28
|
+
generate grids. Choose from the following. (Default: All).
|
|
29
|
+
* 1 - Window
|
|
30
|
+
* 2 - Skylight
|
|
31
|
+
* 3 - All
|
|
32
|
+
quad_only_: Boolean to note whether meshing should be done using Rhino's
|
|
33
|
+
defaults (False), which fills the entire aperture geometry to the edges
|
|
34
|
+
with both quad and tringulated faces, or a mesh with only quad
|
|
35
|
+
faces should be generated. (Default: False).
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
grid: A SensorGrid object that can be used in a grid-based recipe.
|
|
39
|
+
points: The points that are at the center of each grid cell.
|
|
40
|
+
mesh: Analysis mesh that can be passed to the 'Spatial Heatmap' component.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
ghenv.Component.Name = 'HB Sensor Grid from Apertures'
|
|
44
|
+
ghenv.Component.NickName = 'GridApertures'
|
|
45
|
+
ghenv.Component.Message = '1.9.0'
|
|
46
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
47
|
+
ghenv.Component.SubCategory = '0 :: Basic Properties'
|
|
48
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '4'
|
|
49
|
+
|
|
50
|
+
try: # import the ladybug_geometry dependencies
|
|
51
|
+
from ladybug_geometry.geometry3d.mesh import Mesh3D
|
|
52
|
+
except ImportError as e:
|
|
53
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
54
|
+
|
|
55
|
+
try: # import the core honeybee dependencies
|
|
56
|
+
from honeybee.model import Model
|
|
57
|
+
from honeybee.room import Room
|
|
58
|
+
from honeybee.face import Face
|
|
59
|
+
from honeybee.aperture import Aperture
|
|
60
|
+
from honeybee.boundarycondition import Outdoors
|
|
61
|
+
from honeybee.facetype import Floor, Wall, RoofCeiling
|
|
62
|
+
from honeybee.typing import clean_rad_string, clean_and_id_rad_string
|
|
63
|
+
except ImportError as e:
|
|
64
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
65
|
+
|
|
66
|
+
try: # import the honeybee-radiance dependencies
|
|
67
|
+
from honeybee_radiance.sensorgrid import SensorGrid
|
|
68
|
+
except ImportError as e:
|
|
69
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
70
|
+
|
|
71
|
+
try: # import ladybug_rhino dependencies
|
|
72
|
+
from ladybug_rhino.config import conversion_to_meters
|
|
73
|
+
from ladybug_rhino.togeometry import to_joined_gridded_mesh3d
|
|
74
|
+
from ladybug_rhino.fromgeometry import from_mesh3d, from_point3d, from_face3d
|
|
75
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
76
|
+
except ImportError as e:
|
|
77
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
APERTURE_TYPES = {
|
|
81
|
+
'1': Wall,
|
|
82
|
+
'2': RoofCeiling,
|
|
83
|
+
'3': (Wall, RoofCeiling, Floor),
|
|
84
|
+
'Window': Wall,
|
|
85
|
+
'Skylight': RoofCeiling,
|
|
86
|
+
'All': (Wall, RoofCeiling, Floor)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if all_required_inputs(ghenv.Component):
|
|
91
|
+
# set defaults for any blank inputs
|
|
92
|
+
_offset_ = 0.1 / conversion_to_meters() if _offset_ is None else _offset_
|
|
93
|
+
ft = APERTURE_TYPES[_ap_type_.title()] if _ap_type_ is not None \
|
|
94
|
+
else (Wall, RoofCeiling, Floor)
|
|
95
|
+
|
|
96
|
+
# collect all of the relevant apertures
|
|
97
|
+
apertures = []
|
|
98
|
+
for obj in _hb_objs:
|
|
99
|
+
if isinstance(obj, (Model, Room)):
|
|
100
|
+
for face in obj.faces:
|
|
101
|
+
if isinstance(face.boundary_condition, Outdoors) and isinstance(face.type, ft):
|
|
102
|
+
apertures.extend(face.apertures)
|
|
103
|
+
elif isinstance(obj, Face):
|
|
104
|
+
if isinstance(obj.boundary_condition, Outdoors) and isinstance(obj.type, ft):
|
|
105
|
+
apertures.extend(obj.apertures)
|
|
106
|
+
elif isinstance(obj, Aperture):
|
|
107
|
+
if obj.has_parent:
|
|
108
|
+
face = obj.parent
|
|
109
|
+
if isinstance(face.boundary_condition, Outdoors) and isinstance(face.type, ft):
|
|
110
|
+
apertures.append(obj)
|
|
111
|
+
else:
|
|
112
|
+
apertures.append(obj)
|
|
113
|
+
else:
|
|
114
|
+
raise TypeError(
|
|
115
|
+
'Expected Honeybee Aperture, Face, Room or Model. Got {}.'.format(type(obj)))
|
|
116
|
+
|
|
117
|
+
# greneate the meshes and grids from the faces
|
|
118
|
+
if len(apertures) != 0:
|
|
119
|
+
# create the gridded ladybug Mesh3D
|
|
120
|
+
f_geos = [ap.geometry for ap in apertures]
|
|
121
|
+
if quad_only_: # use Ladybug's built-in meshing methods
|
|
122
|
+
lb_meshes = []
|
|
123
|
+
for geo in f_geos:
|
|
124
|
+
try:
|
|
125
|
+
lb_meshes.append(geo.mesh_grid(_grid_size, offset=_offset_))
|
|
126
|
+
except AssertionError:
|
|
127
|
+
continue
|
|
128
|
+
if len(lb_meshes) == 0:
|
|
129
|
+
lb_mesh = None
|
|
130
|
+
else:
|
|
131
|
+
lb_mesh = lb_meshes[0] if len(lb_meshes) == 1 else \
|
|
132
|
+
Mesh3D.join_meshes(lb_meshes)
|
|
133
|
+
else: # use Rhino's default meshing
|
|
134
|
+
rh_faces = [from_face3d(face) for face in f_geos]
|
|
135
|
+
lb_mesh = to_joined_gridded_mesh3d(rh_faces, _grid_size, _offset_)
|
|
136
|
+
|
|
137
|
+
if lb_mesh is not None:
|
|
138
|
+
# extract positions and directions from the mesh
|
|
139
|
+
mesh = from_mesh3d(lb_mesh)
|
|
140
|
+
points = [from_point3d(pt) for pt in lb_mesh.face_centroids]
|
|
141
|
+
base_poss = [(pt.x, pt.y, pt.z) for pt in lb_mesh.face_centroids]
|
|
142
|
+
base_dirs = [(vec.x, vec.y, vec.z) for vec in lb_mesh.face_normals]
|
|
143
|
+
|
|
144
|
+
# create the sensor grid
|
|
145
|
+
f_nm = 'Windows'
|
|
146
|
+
if isinstance(ft, tuple):
|
|
147
|
+
f_nm = 'Apertures'
|
|
148
|
+
elif ft is RoofCeiling:
|
|
149
|
+
f_nm = 'Skylights'
|
|
150
|
+
g_name = clean_rad_string('{}_Exterior{}'.format(_hb_objs[0].display_name, f_nm)) \
|
|
151
|
+
if len(_hb_objs) == 1 else clean_and_id_rad_string('Exterior{}'.format(f_nm))
|
|
152
|
+
grid = SensorGrid.from_position_and_direction(g_name, base_poss, base_dirs)
|
|
153
|
+
grid.mesh = lb_mesh
|