honeybee-schema 1.59.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_schema/__init__.py +1 -0
- honeybee_schema/__main__.py +4 -0
- honeybee_schema/_base.py +42 -0
- honeybee_schema/altnumber.py +18 -0
- honeybee_schema/boundarycondition.py +81 -0
- honeybee_schema/cli.py +115 -0
- honeybee_schema/comparison.py +208 -0
- honeybee_schema/doe2/__init__.py +0 -0
- honeybee_schema/doe2/properties.py +75 -0
- honeybee_schema/energy/__init__.py +0 -0
- honeybee_schema/energy/_base.py +64 -0
- honeybee_schema/energy/construction.py +324 -0
- honeybee_schema/energy/constructionset.py +359 -0
- honeybee_schema/energy/daylight.py +62 -0
- honeybee_schema/energy/designday.py +212 -0
- honeybee_schema/energy/generator.py +140 -0
- honeybee_schema/energy/global_constructionset.py +129 -0
- honeybee_schema/energy/hvac/__init__.py +0 -0
- honeybee_schema/energy/hvac/_template.py +38 -0
- honeybee_schema/energy/hvac/allair.py +257 -0
- honeybee_schema/energy/hvac/detailed.py +20 -0
- honeybee_schema/energy/hvac/doas.py +248 -0
- honeybee_schema/energy/hvac/heatcool.py +309 -0
- honeybee_schema/energy/hvac/idealair.py +107 -0
- honeybee_schema/energy/internalmass.py +25 -0
- honeybee_schema/energy/load.py +627 -0
- honeybee_schema/energy/material.py +949 -0
- honeybee_schema/energy/programtype.py +117 -0
- honeybee_schema/energy/properties.py +382 -0
- honeybee_schema/energy/schedule.py +350 -0
- honeybee_schema/energy/shw.py +53 -0
- honeybee_schema/energy/simulation.py +440 -0
- honeybee_schema/energy/ventcool.py +337 -0
- honeybee_schema/geometry.py +161 -0
- honeybee_schema/model.py +473 -0
- honeybee_schema/projectinfo.py +94 -0
- honeybee_schema/radiance/__init__.py +0 -0
- honeybee_schema/radiance/_base.py +22 -0
- honeybee_schema/radiance/asset.py +191 -0
- honeybee_schema/radiance/global_modifierset.py +92 -0
- honeybee_schema/radiance/modifier.py +373 -0
- honeybee_schema/radiance/modifierset.py +296 -0
- honeybee_schema/radiance/properties.py +149 -0
- honeybee_schema/radiance/state.py +69 -0
- honeybee_schema/updater/__init__.py +0 -0
- honeybee_schema/updater/version_1_39_12.py +14 -0
- honeybee_schema/updater/version_1_40_1.py +153 -0
- honeybee_schema/updater/version_1_43_1.py +18 -0
- honeybee_schema/updater/version_1_43_2.py +12 -0
- honeybee_schema/updater/version_1_43_5.py +11 -0
- honeybee_schema/validation.py +205 -0
- honeybee_schema-1.59.1.dist-info/METADATA +108 -0
- honeybee_schema-1.59.1.dist-info/RECORD +57 -0
- honeybee_schema-1.59.1.dist-info/WHEEL +5 -0
- honeybee_schema-1.59.1.dist-info/entry_points.txt +2 -0
- honeybee_schema-1.59.1.dist-info/licenses/LICENSE +23 -0
- honeybee_schema-1.59.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
"""SensorGrid and Sensor Schema"""
|
2
|
+
from pydantic import Field, constr
|
3
|
+
from typing import List
|
4
|
+
from enum import Enum
|
5
|
+
from ..geometry import Mesh3D, Face3D
|
6
|
+
from .._base import NoExtraBaseModel
|
7
|
+
from ._base import IDdRadianceBaseModel
|
8
|
+
|
9
|
+
|
10
|
+
class _RadianceAsset(IDdRadianceBaseModel):
|
11
|
+
"""Hidden base class for all Radiance Assets."""
|
12
|
+
|
13
|
+
room_identifier: str = Field(
|
14
|
+
None,
|
15
|
+
regex=r'^[.A-Za-z0-9_-]+$',
|
16
|
+
min_length=1,
|
17
|
+
max_length=100,
|
18
|
+
description='Optional text string for the Room identifier to which this '
|
19
|
+
'object belongs. This will be used to narrow down the number of '
|
20
|
+
'aperture groups that have to be run with this sensor grid. If None, '
|
21
|
+
'the grid will be run with all aperture groups in the model.'
|
22
|
+
)
|
23
|
+
|
24
|
+
light_path: List[List[str]] = Field(
|
25
|
+
None,
|
26
|
+
description='Get or set a list of lists for the light path from the object to '
|
27
|
+
'the sky. Each sub-list contains identifiers of aperture groups through which '
|
28
|
+
'light passes. (eg. [["SouthWindow1"], ["static_apertures", "NorthWindow2"]]).'
|
29
|
+
'Setting this property will override any auto-calculation of the light '
|
30
|
+
'path from the model and room_identifier upon export to the simulation.'
|
31
|
+
)
|
32
|
+
|
33
|
+
|
34
|
+
class Sensor(NoExtraBaseModel):
|
35
|
+
"""A single Radiance of sensors."""
|
36
|
+
|
37
|
+
type: constr(regex='^Sensor$') = 'Sensor'
|
38
|
+
|
39
|
+
pos: List[float] = Field(
|
40
|
+
...,
|
41
|
+
description="Position of sensor in space as an array of (x, y, z) values.",
|
42
|
+
min_items=3,
|
43
|
+
max_items=3
|
44
|
+
)
|
45
|
+
|
46
|
+
dir: List[float] = Field(
|
47
|
+
...,
|
48
|
+
description="Direction of sensor as an array of (x, y, z) values.",
|
49
|
+
min_items=3,
|
50
|
+
max_items=3
|
51
|
+
)
|
52
|
+
|
53
|
+
|
54
|
+
class SensorGrid(_RadianceAsset):
|
55
|
+
"""A grid of sensors."""
|
56
|
+
|
57
|
+
type: constr(regex='^SensorGrid$') = 'SensorGrid'
|
58
|
+
|
59
|
+
sensors: List[Sensor] = Field(
|
60
|
+
...,
|
61
|
+
description='A list of sensors that belong to the grid.'
|
62
|
+
)
|
63
|
+
|
64
|
+
mesh: Mesh3D = Field(
|
65
|
+
None,
|
66
|
+
description='An optional Mesh3D that aligns with the sensors and can be '
|
67
|
+
'used for visualization of the grid. Note that the number of sensors in '
|
68
|
+
'the grid must match the number of faces or the number vertices within '
|
69
|
+
'the Mesh3D.'
|
70
|
+
)
|
71
|
+
|
72
|
+
base_geometry: List[Face3D] = Field(
|
73
|
+
None,
|
74
|
+
description='An optional array of Face3D used to represent the grid. '
|
75
|
+
'There are no restrictions on how this property relates to the sensors and it '
|
76
|
+
'is provided only to assist with the display of the grid when the number '
|
77
|
+
'of sensors or the mesh is too large to be practically visualized.'
|
78
|
+
)
|
79
|
+
|
80
|
+
group_identifier: str = Field(
|
81
|
+
default=None,
|
82
|
+
description="An optional string to note the sensor grid group ' \
|
83
|
+
'to which the sensor is a part of. Grids sharing the same ' \
|
84
|
+
'group_identifier will be written to the same subfolder in Radiance ' \
|
85
|
+
'folder (default: None)."
|
86
|
+
)
|
87
|
+
|
88
|
+
|
89
|
+
class ViewType(str, Enum):
|
90
|
+
"""A single character for the view type (-vt)."""
|
91
|
+
perspective = 'v'
|
92
|
+
hemispherical_fisheye = 'h'
|
93
|
+
parallel = 'l'
|
94
|
+
cylindrical_panorama = 'c'
|
95
|
+
angular_fisheye = 'a'
|
96
|
+
planisphere = 's'
|
97
|
+
|
98
|
+
|
99
|
+
class View(_RadianceAsset):
|
100
|
+
"""A single Radiance of sensors."""
|
101
|
+
|
102
|
+
type: constr(regex='^View$') = 'View'
|
103
|
+
|
104
|
+
position: List[float] = Field(
|
105
|
+
...,
|
106
|
+
description='The view position (-vp) as an array of (x, y, z) values.'
|
107
|
+
'This is the focal point of a perspective view or the center of a '
|
108
|
+
'parallel projection.',
|
109
|
+
min_items=3,
|
110
|
+
max_items=3
|
111
|
+
)
|
112
|
+
|
113
|
+
direction: List[float] = Field(
|
114
|
+
...,
|
115
|
+
description='The view direction (-vd) as an array of (x, y, z) values.'
|
116
|
+
'The length of this vector indicates the focal distance as needed by '
|
117
|
+
'the pixel depth of field (-pd) in rpict.',
|
118
|
+
min_items=3,
|
119
|
+
max_items=3
|
120
|
+
)
|
121
|
+
|
122
|
+
up_vector: List[float] = Field(
|
123
|
+
...,
|
124
|
+
description='The view up (-vu) vector as an array of (x, y, z) values.',
|
125
|
+
min_items=3,
|
126
|
+
max_items=3
|
127
|
+
)
|
128
|
+
|
129
|
+
view_type: ViewType = ViewType.perspective
|
130
|
+
|
131
|
+
h_size: float = Field(
|
132
|
+
60,
|
133
|
+
description='A number for the horizontal field of view in degrees (for '
|
134
|
+
'all perspective projections including fisheye). For a parallel '
|
135
|
+
'projection, this is the view width in world coordinates.'
|
136
|
+
)
|
137
|
+
|
138
|
+
v_size: float = Field(
|
139
|
+
60,
|
140
|
+
description='A number for the vertical field of view in degrees (for '
|
141
|
+
'all perspective projections including fisheye). For a parallel '
|
142
|
+
'projection, this is the view width in world coordinates.'
|
143
|
+
)
|
144
|
+
|
145
|
+
shift: float = Field(
|
146
|
+
None,
|
147
|
+
description='The view shift (-vs). This is the amount the actual '
|
148
|
+
'image will be shifted to the right of the specified view. This '
|
149
|
+
'option is useful for generating skewed perspectives or rendering '
|
150
|
+
'an image a piece at a time. A value of 1 means that the rendered '
|
151
|
+
'image starts just to the right of the normal view. A value of -1 '
|
152
|
+
'would be to the left. Larger or fractional values are permitted '
|
153
|
+
'as well.'
|
154
|
+
)
|
155
|
+
|
156
|
+
lift: float = Field(
|
157
|
+
None,
|
158
|
+
description='The view lift (-vl). This is the amount the actual '
|
159
|
+
'image will be lifted up from the specified view. This '
|
160
|
+
'option is useful for generating skewed perspectives or rendering '
|
161
|
+
'an image a piece at a time. A value of 1 means that the rendered '
|
162
|
+
'image starts just to the right of the normal view. A value of -1 '
|
163
|
+
'would be to the left. Larger or fractional values are permitted '
|
164
|
+
'as well.'
|
165
|
+
)
|
166
|
+
|
167
|
+
fore_clip: float = Field(
|
168
|
+
None,
|
169
|
+
description='View fore clip (-vo) at a distance from the view point.'
|
170
|
+
'The plane will be perpendicular to the view direction for perspective '
|
171
|
+
'and parallel view types. For fisheye view types, the clipping plane is '
|
172
|
+
'actually a clipping sphere, centered on the view point with fore_clip radius. '
|
173
|
+
'Objects in front of this imaginary surface will not be visible.'
|
174
|
+
)
|
175
|
+
|
176
|
+
aft_clip: float = Field(
|
177
|
+
None,
|
178
|
+
description='View aft clip (-va) at a distance from the view point.'
|
179
|
+
'Like the view fore plane, it will be perpendicular to the view '
|
180
|
+
'direction for perspective and parallel view types. For fisheye '
|
181
|
+
'view types, the clipping plane is actually a clipping sphere, '
|
182
|
+
'centered on the view point with radius val.'
|
183
|
+
)
|
184
|
+
|
185
|
+
group_identifier: str = Field(
|
186
|
+
default=None,
|
187
|
+
description="An optional string to note the view group ' \
|
188
|
+
'to which the sensor is a part of. Views sharing the same ' \
|
189
|
+
'group_identifier will be written to the same subfolder in Radiance ' \
|
190
|
+
'folder (default: None)."
|
191
|
+
)
|
@@ -0,0 +1,92 @@
|
|
1
|
+
"""Global modifier-set for Model."""
|
2
|
+
import pathlib
|
3
|
+
import json
|
4
|
+
|
5
|
+
from typing import List, Union
|
6
|
+
from pydantic import constr, Field
|
7
|
+
|
8
|
+
from honeybee_standards import radiance_default
|
9
|
+
|
10
|
+
from .._base import NoExtraBaseModel
|
11
|
+
from .modifierset import WallModifierSetAbridged, FloorModifierSetAbridged, \
|
12
|
+
RoofCeilingModifierSetAbridged, ApertureModifierSetAbridged, \
|
13
|
+
DoorModifierSetAbridged, ShadeModifierSetAbridged
|
14
|
+
from .modifier import Plastic, Glass, Trans
|
15
|
+
|
16
|
+
|
17
|
+
# import modifierset default values from honeybee standards
|
18
|
+
_DEFAULTS = json.loads(pathlib.Path(radiance_default).read_text())
|
19
|
+
_MOD_SET = [
|
20
|
+
ms for ms in _DEFAULTS['modifier_sets']
|
21
|
+
if ms['identifier'] == 'Generic_Interior_Visible_Modifier_Set'][0]
|
22
|
+
_MODIFIER_NAMES = [
|
23
|
+
'generic_wall_0.50', 'generic_floor_0.20', 'generic_ceiling_0.80',
|
24
|
+
'generic_interior_window_vis_0.88', 'generic_exterior_window_vis_0.64',
|
25
|
+
'generic_opaque_door_0.50', 'generic_interior_shade_0.50',
|
26
|
+
'generic_exterior_shade_0.35', 'generic_context_0.20', 'air_boundary'
|
27
|
+
]
|
28
|
+
_MODIFIERS = [
|
29
|
+
Plastic.parse_obj(m) if m['type'] == 'Plastic'
|
30
|
+
else Glass.parse_obj(m) if m['type'] == 'Glass'
|
31
|
+
else Trans.parse_obj(m)
|
32
|
+
for m in _DEFAULTS['modifiers'] if m['identifier'] in _MODIFIER_NAMES
|
33
|
+
]
|
34
|
+
|
35
|
+
|
36
|
+
class GlobalModifierSet(NoExtraBaseModel):
|
37
|
+
|
38
|
+
type: constr(regex='^GlobalModifierSet$') = 'GlobalModifierSet'
|
39
|
+
|
40
|
+
modifiers: List[Union[Plastic, Glass, Trans]] = Field(
|
41
|
+
default=_MODIFIERS,
|
42
|
+
description='Global Honeybee Radiance modifiers.',
|
43
|
+
readOnly=True
|
44
|
+
)
|
45
|
+
|
46
|
+
wall_set: WallModifierSetAbridged = Field(
|
47
|
+
default=WallModifierSetAbridged.parse_obj(_MOD_SET['wall_set']),
|
48
|
+
description='Global Honeybee WallModifierSet.',
|
49
|
+
readOnly=True
|
50
|
+
)
|
51
|
+
|
52
|
+
floor_set: FloorModifierSetAbridged = Field(
|
53
|
+
default=FloorModifierSetAbridged.parse_obj(_MOD_SET['floor_set']),
|
54
|
+
description='Global Honeybee FloorModifierSet.',
|
55
|
+
readOnly=True
|
56
|
+
)
|
57
|
+
|
58
|
+
roof_ceiling_set: RoofCeilingModifierSetAbridged = Field(
|
59
|
+
default=RoofCeilingModifierSetAbridged.parse_obj(_MOD_SET['roof_ceiling_set']),
|
60
|
+
description='Global Honeybee RoofCeilingModifierSet.',
|
61
|
+
readOnly=True
|
62
|
+
)
|
63
|
+
|
64
|
+
aperture_set: ApertureModifierSetAbridged = Field(
|
65
|
+
default=ApertureModifierSetAbridged.parse_obj(_MOD_SET['aperture_set']),
|
66
|
+
description='Global Honeybee ApertureModifierSet.',
|
67
|
+
readOnly=True
|
68
|
+
)
|
69
|
+
|
70
|
+
door_set: DoorModifierSetAbridged = Field(
|
71
|
+
default=DoorModifierSetAbridged.parse_obj(_MOD_SET['door_set']),
|
72
|
+
description='Global Honeybee DoorModifierSet.',
|
73
|
+
readOnly=True
|
74
|
+
)
|
75
|
+
|
76
|
+
shade_set: ShadeModifierSetAbridged = Field(
|
77
|
+
default=ShadeModifierSetAbridged.parse_obj(_MOD_SET['shade_set']),
|
78
|
+
description='Global Honeybee ShadeModifierSet.',
|
79
|
+
readOnly=True
|
80
|
+
)
|
81
|
+
|
82
|
+
air_boundary_modifier: str = Field(
|
83
|
+
default=_MOD_SET['air_boundary_modifier'],
|
84
|
+
description='Global Honeybee Modifier for AirBoundary Faces.',
|
85
|
+
readOnly=True
|
86
|
+
)
|
87
|
+
|
88
|
+
context_modifier: str = Field(
|
89
|
+
default='generic_context_0.20',
|
90
|
+
description='Global Honeybee Modifier for context Shades.',
|
91
|
+
readOnly=True
|
92
|
+
)
|
@@ -0,0 +1,373 @@
|
|
1
|
+
"""Modifier Schema"""
|
2
|
+
from __future__ import annotations
|
3
|
+
from pydantic import Field, BaseModel, constr, validator
|
4
|
+
from typing import List, Union, Optional
|
5
|
+
from ._base import IDdRadianceBaseModel
|
6
|
+
|
7
|
+
|
8
|
+
class Void(BaseModel):
|
9
|
+
"""Void modifier"""
|
10
|
+
|
11
|
+
type: constr(regex='^Void$') = 'Void'
|
12
|
+
|
13
|
+
|
14
|
+
class ModifierBase(IDdRadianceBaseModel):
|
15
|
+
"""Base class for Radiance Modifiers"""
|
16
|
+
|
17
|
+
type: constr(regex='^ModifierBase$') = 'ModifierBase'
|
18
|
+
|
19
|
+
|
20
|
+
class Mirror(ModifierBase):
|
21
|
+
"""Radiance mirror material."""
|
22
|
+
|
23
|
+
type: constr(regex='^Mirror$') = 'Mirror'
|
24
|
+
|
25
|
+
modifier: Optional[_REFERENCE_UNION_MODIFIERS] = Field(
|
26
|
+
default=Void(),
|
27
|
+
description='Material modifier.'
|
28
|
+
)
|
29
|
+
|
30
|
+
dependencies: List[_REFERENCE_UNION_MODIFIERS] = Field(
|
31
|
+
default=None,
|
32
|
+
description='List of modifiers that this modifier depends on. This argument '
|
33
|
+
'is only useful for defining advanced modifiers where the modifier is defined '
|
34
|
+
'based on other modifiers.'
|
35
|
+
)
|
36
|
+
|
37
|
+
r_reflectance: float = Field(
|
38
|
+
default=1,
|
39
|
+
ge=0,
|
40
|
+
le=1,
|
41
|
+
description='A value between 0 and 1 for the red channel reflectance.'
|
42
|
+
)
|
43
|
+
|
44
|
+
g_reflectance: float = Field(
|
45
|
+
default=1,
|
46
|
+
ge=0,
|
47
|
+
le=1,
|
48
|
+
description='A value between 0 and 1 for the green channel reflectance.'
|
49
|
+
)
|
50
|
+
|
51
|
+
b_reflectance: float = Field(
|
52
|
+
default=1,
|
53
|
+
ge=0,
|
54
|
+
le=1,
|
55
|
+
description='A value between 0 and 1 for the blue channel reflectance.'
|
56
|
+
)
|
57
|
+
|
58
|
+
alternate_material: _REFERENCE_UNION_MODIFIERS = Field(
|
59
|
+
default=None,
|
60
|
+
description='An optional material (like the illum type) that may be used to '
|
61
|
+
'specify a different material to be used for shading non-source rays. '
|
62
|
+
'If None, this will keep the alternat_material as mirror. If this alternate '
|
63
|
+
'material is given as Void, then the mirror surface will be invisible. '
|
64
|
+
'Using Void is only appropriate if the surface hides other (more '
|
65
|
+
'detailed) geometry with the same overall reflectance.'
|
66
|
+
)
|
67
|
+
|
68
|
+
|
69
|
+
class Plastic(ModifierBase):
|
70
|
+
"""Radiance plastic material."""
|
71
|
+
|
72
|
+
type: constr(regex='^Plastic$') = 'Plastic'
|
73
|
+
|
74
|
+
modifier: Optional[_REFERENCE_UNION_MODIFIERS] = Field(
|
75
|
+
default=Void(),
|
76
|
+
description='Material modifier.'
|
77
|
+
)
|
78
|
+
|
79
|
+
dependencies: List[_REFERENCE_UNION_MODIFIERS] = Field(
|
80
|
+
default=None,
|
81
|
+
description='List of modifiers that this modifier depends on. This argument '
|
82
|
+
'is only useful for defining advanced modifiers where the modifier is defined '
|
83
|
+
'based on other modifiers.'
|
84
|
+
)
|
85
|
+
|
86
|
+
r_reflectance: float = Field(
|
87
|
+
default=0.0,
|
88
|
+
ge=0,
|
89
|
+
le=1,
|
90
|
+
description='A value between 0 and 1 for the red channel reflectance.'
|
91
|
+
)
|
92
|
+
|
93
|
+
g_reflectance: float = Field(
|
94
|
+
default=0.0,
|
95
|
+
ge=0,
|
96
|
+
le=1,
|
97
|
+
description='A value between 0 and 1 for the green channel reflectance.'
|
98
|
+
)
|
99
|
+
|
100
|
+
b_reflectance: float = Field(
|
101
|
+
default=0.0,
|
102
|
+
ge=0,
|
103
|
+
le=1,
|
104
|
+
description='A value between 0 and 1 for the blue channel reflectance.'
|
105
|
+
)
|
106
|
+
|
107
|
+
specularity: float = Field(
|
108
|
+
default=0,
|
109
|
+
ge=0,
|
110
|
+
le=1,
|
111
|
+
description='A value between 0 and 1 for the fraction of specularity. '
|
112
|
+
'Specularity fractions greater than 0.1 are not realistic for non-metallic '
|
113
|
+
'materials.'
|
114
|
+
)
|
115
|
+
|
116
|
+
roughness: float = Field(
|
117
|
+
default=0,
|
118
|
+
ge=0,
|
119
|
+
le=1,
|
120
|
+
description='A value between 0 and 1 for the roughness, specified as the '
|
121
|
+
'RMS slope of surface facets. Roughness greater than 0.2 are not realistic.'
|
122
|
+
)
|
123
|
+
|
124
|
+
|
125
|
+
class Metal(Plastic):
|
126
|
+
"""Radiance metal material."""
|
127
|
+
|
128
|
+
type: constr(regex='^Metal$') = 'Metal'
|
129
|
+
|
130
|
+
specularity: float = Field(
|
131
|
+
default=0.9,
|
132
|
+
ge=0,
|
133
|
+
le=1,
|
134
|
+
description='A value between 0 and 1 for the fraction of specularity. '
|
135
|
+
'Specularity fractions lower than 0.9 are not realistic for metallic materials.'
|
136
|
+
)
|
137
|
+
|
138
|
+
|
139
|
+
class Trans(Plastic):
|
140
|
+
"""Radiance Translucent material."""
|
141
|
+
|
142
|
+
type: constr(regex='^Trans$') = 'Trans'
|
143
|
+
|
144
|
+
transmitted_diff: float = Field(
|
145
|
+
default=0,
|
146
|
+
ge=0,
|
147
|
+
le=1,
|
148
|
+
description='The fraction of transmitted light that is transmitted diffusely in '
|
149
|
+
'a scattering fashion.'
|
150
|
+
)
|
151
|
+
|
152
|
+
transmitted_spec: float = Field(
|
153
|
+
default=0,
|
154
|
+
ge=0,
|
155
|
+
le=1,
|
156
|
+
description='The fraction of transmitted light that is not diffusely scattered.'
|
157
|
+
)
|
158
|
+
|
159
|
+
|
160
|
+
class Glass(ModifierBase):
|
161
|
+
"""Radiance glass material."""
|
162
|
+
|
163
|
+
type: constr(regex='^Glass$') = 'Glass'
|
164
|
+
|
165
|
+
modifier: Optional[_REFERENCE_UNION_MODIFIERS] = Field(
|
166
|
+
default=Void(),
|
167
|
+
description='Material modifier.'
|
168
|
+
)
|
169
|
+
|
170
|
+
dependencies: List[_REFERENCE_UNION_MODIFIERS] = Field(
|
171
|
+
default=None,
|
172
|
+
description='List of modifiers that this modifier depends on. This argument '
|
173
|
+
'is only useful for defining advanced modifiers where the modifier is '
|
174
|
+
'defined based on other modifiers.'
|
175
|
+
)
|
176
|
+
|
177
|
+
r_transmissivity: float = Field(
|
178
|
+
default=0.0,
|
179
|
+
ge=0,
|
180
|
+
le=1,
|
181
|
+
description='A value between 0 and 1 for the red channel transmissivity.'
|
182
|
+
)
|
183
|
+
|
184
|
+
g_transmissivity: float = Field(
|
185
|
+
default=0.0,
|
186
|
+
ge=0,
|
187
|
+
le=1,
|
188
|
+
description='A value between 0 and 1 for the green channel transmissivity.'
|
189
|
+
)
|
190
|
+
|
191
|
+
b_transmissivity: float = Field(
|
192
|
+
default=0.0,
|
193
|
+
ge=0,
|
194
|
+
le=1,
|
195
|
+
description='A value between 0 and 1 for the blue channel transmissivity.'
|
196
|
+
)
|
197
|
+
|
198
|
+
refraction_index: Optional[float] = Field(
|
199
|
+
default=1.52,
|
200
|
+
gt=1,
|
201
|
+
description='A value greater than 1 for the index of refraction. Typical '
|
202
|
+
'values are 1.52 for float glass and 1.4 for ETFE.'
|
203
|
+
)
|
204
|
+
|
205
|
+
|
206
|
+
class BSDF(ModifierBase):
|
207
|
+
"""Radiance BSDF (Bidirectional Scattering Distribution Function) material."""
|
208
|
+
|
209
|
+
type: constr(regex='^BSDF$') = 'BSDF'
|
210
|
+
|
211
|
+
modifier: Optional[_REFERENCE_UNION_MODIFIERS] = Field(
|
212
|
+
default=Void(),
|
213
|
+
description='Material modifier.'
|
214
|
+
)
|
215
|
+
|
216
|
+
dependencies: List[_REFERENCE_UNION_MODIFIERS] = Field(
|
217
|
+
default=None,
|
218
|
+
description='List of modifiers that this modifier depends on. This argument '
|
219
|
+
'is only useful for defining advanced modifiers where the modifier is defined '
|
220
|
+
'based on other modifiers.'
|
221
|
+
)
|
222
|
+
|
223
|
+
up_orientation: List[float] = Field(
|
224
|
+
default=(0.01, 0.01, 1.00),
|
225
|
+
min_items=3,
|
226
|
+
max_items=3,
|
227
|
+
description='Vector as sequence that sets the hemisphere that the BSDF '
|
228
|
+
'material faces.'
|
229
|
+
)
|
230
|
+
|
231
|
+
thickness: float = Field(
|
232
|
+
default=0,
|
233
|
+
description='Optional number to set the thickness of the BSDF material '
|
234
|
+
'Sign of thickness indicates whether proxied geometry is behind the BSDF '
|
235
|
+
'surface (when thickness is positive) or in front (when thickness is '
|
236
|
+
'negative).'
|
237
|
+
)
|
238
|
+
|
239
|
+
function_file: str = Field(
|
240
|
+
default='.',
|
241
|
+
min_length=1,
|
242
|
+
max_length=100,
|
243
|
+
description='Optional input for function file. Using "." will ensure that '
|
244
|
+
'BSDF data is written to the root of wherever a given study is run.'
|
245
|
+
)
|
246
|
+
|
247
|
+
transform: str = Field(
|
248
|
+
default=None,
|
249
|
+
min_length=1,
|
250
|
+
max_length=100,
|
251
|
+
description='Optional transform input to scale the thickness and reorient '
|
252
|
+
'the up vector.'
|
253
|
+
)
|
254
|
+
|
255
|
+
bsdf_data: str = Field(
|
256
|
+
...,
|
257
|
+
description='A string with the contents of the BSDF XML file.'
|
258
|
+
)
|
259
|
+
|
260
|
+
front_diffuse_reflectance: List[float] = Field(
|
261
|
+
default=None,
|
262
|
+
min_items=3,
|
263
|
+
max_items=3,
|
264
|
+
description='Optional additional front diffuse reflectance as sequence of '
|
265
|
+
'three RGB numbers.'
|
266
|
+
)
|
267
|
+
|
268
|
+
back_diffuse_reflectance: List[float] = Field(
|
269
|
+
default=None,
|
270
|
+
min_items=3,
|
271
|
+
max_items=3,
|
272
|
+
description='Optional additional back diffuse reflectance as sequence of '
|
273
|
+
'three RGB numbers.'
|
274
|
+
)
|
275
|
+
|
276
|
+
diffuse_transmittance: List[float] = Field(
|
277
|
+
default=None,
|
278
|
+
min_items=3,
|
279
|
+
max_items=3,
|
280
|
+
description='Optional additional diffuse transmittance as sequence of '
|
281
|
+
'three RGB numbers.'
|
282
|
+
)
|
283
|
+
|
284
|
+
@validator('front_diffuse_reflectance')
|
285
|
+
def check_front_diff_value(cls, values):
|
286
|
+
"""Ensure every list value is between 0 and 1."""
|
287
|
+
assert all(0 <= v <= 1 for v in values), \
|
288
|
+
'Every value in front diffuse reflectance must be between 0 and 1.'
|
289
|
+
return values
|
290
|
+
|
291
|
+
@validator('back_diffuse_reflectance')
|
292
|
+
def check_back_diff_value(cls, values):
|
293
|
+
"""Ensure every list value is between 0 and 1."""
|
294
|
+
assert all(0 <= v <= 1 for v in values), \
|
295
|
+
'Every value in back diffuse reflectance must be between 0 and 1.'
|
296
|
+
return values
|
297
|
+
|
298
|
+
@validator('diffuse_transmittance')
|
299
|
+
def check_diff_trans_value(cls, values):
|
300
|
+
"""Ensure every list value is between 0 and 1."""
|
301
|
+
assert all(0 <= v <= 1 for v in values), \
|
302
|
+
'Every value in diffuse transmittance must be between 0 and 1.'
|
303
|
+
return values
|
304
|
+
|
305
|
+
|
306
|
+
class Light(ModifierBase):
|
307
|
+
"""Radiance Light material."""
|
308
|
+
|
309
|
+
type: constr(regex='^Light$') = 'Light'
|
310
|
+
|
311
|
+
modifier: Optional[_REFERENCE_UNION_MODIFIERS] = Field(
|
312
|
+
default=Void(),
|
313
|
+
description='Material modifier.'
|
314
|
+
)
|
315
|
+
|
316
|
+
dependencies: List[_REFERENCE_UNION_MODIFIERS] = Field(
|
317
|
+
default=None,
|
318
|
+
description='List of modifiers that this modifier depends on. This argument '
|
319
|
+
'is only useful for defining advanced modifiers where the modifier is '
|
320
|
+
'defined based on other modifiers.'
|
321
|
+
)
|
322
|
+
|
323
|
+
r_emittance: float = Field(
|
324
|
+
default=0.0,
|
325
|
+
ge=0,
|
326
|
+
le=1,
|
327
|
+
description='A value between 0 and 1 for the red channel of the modifier.'
|
328
|
+
)
|
329
|
+
|
330
|
+
g_emittance: float = Field(
|
331
|
+
default=0.0,
|
332
|
+
ge=0,
|
333
|
+
le=1,
|
334
|
+
description='A value between 0 and 1 for the green channel of the modifier.'
|
335
|
+
)
|
336
|
+
|
337
|
+
b_emittance: float = Field(
|
338
|
+
default=0.0,
|
339
|
+
ge=0,
|
340
|
+
le=1,
|
341
|
+
description='A value between 0 and 1 for the blue channel of the modifier.'
|
342
|
+
)
|
343
|
+
|
344
|
+
|
345
|
+
class Glow(Light):
|
346
|
+
"""Radiance Glow material."""
|
347
|
+
|
348
|
+
type: constr(regex='^Glow$') = 'Glow'
|
349
|
+
|
350
|
+
max_radius: float = Field(
|
351
|
+
default=0,
|
352
|
+
description='Maximum radius for shadow testing. Objects with zero radius '
|
353
|
+
'are permissable and may participate in interreflection calculation (though '
|
354
|
+
'they are not representative of real light sources). Negative values will '
|
355
|
+
'never contribute to scene illumination.'
|
356
|
+
)
|
357
|
+
|
358
|
+
|
359
|
+
# Union Modifier Schema objects defined for type reference
|
360
|
+
_REFERENCE_UNION_MODIFIERS = \
|
361
|
+
Union[Plastic, Glass, BSDF, Glow, Light, Trans, Metal, Void, Mirror]
|
362
|
+
|
363
|
+
# Required for self.referencing model
|
364
|
+
# see https://pydantic-docs.helpmanual.io/#self-referencing-models
|
365
|
+
Mirror.update_forward_refs()
|
366
|
+
Plastic.update_forward_refs()
|
367
|
+
Glass.update_forward_refs()
|
368
|
+
BSDF.update_forward_refs()
|
369
|
+
Glow.update_forward_refs()
|
370
|
+
Light.update_forward_refs()
|
371
|
+
Trans.update_forward_refs()
|
372
|
+
Metal.update_forward_refs()
|
373
|
+
Void.update_forward_refs()
|