honeybee-radiance 1.66.190__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.
Potentially problematic release.
This version of honeybee-radiance might be problematic. Click here for more details.
- honeybee_radiance/__init__.py +11 -0
- honeybee_radiance/__main__.py +4 -0
- honeybee_radiance/_extend_honeybee.py +93 -0
- honeybee_radiance/cli/__init__.py +88 -0
- honeybee_radiance/cli/dc.py +400 -0
- honeybee_radiance/cli/edit.py +529 -0
- honeybee_radiance/cli/glare.py +118 -0
- honeybee_radiance/cli/grid.py +859 -0
- honeybee_radiance/cli/lib.py +458 -0
- honeybee_radiance/cli/modifier.py +133 -0
- honeybee_radiance/cli/mtx.py +226 -0
- honeybee_radiance/cli/multiphase.py +1034 -0
- honeybee_radiance/cli/octree.py +640 -0
- honeybee_radiance/cli/postprocess.py +1186 -0
- honeybee_radiance/cli/raytrace.py +219 -0
- honeybee_radiance/cli/rpict.py +125 -0
- honeybee_radiance/cli/schedule.py +56 -0
- honeybee_radiance/cli/setconfig.py +63 -0
- honeybee_radiance/cli/sky.py +545 -0
- honeybee_radiance/cli/study.py +66 -0
- honeybee_radiance/cli/sunpath.py +331 -0
- honeybee_radiance/cli/threephase.py +255 -0
- honeybee_radiance/cli/translate.py +400 -0
- honeybee_radiance/cli/util.py +121 -0
- honeybee_radiance/cli/view.py +261 -0
- honeybee_radiance/cli/viewfactor.py +347 -0
- honeybee_radiance/config.json +6 -0
- honeybee_radiance/config.py +427 -0
- honeybee_radiance/dictutil.py +50 -0
- honeybee_radiance/dynamic/__init__.py +5 -0
- honeybee_radiance/dynamic/group.py +479 -0
- honeybee_radiance/dynamic/multiphase.py +557 -0
- honeybee_radiance/dynamic/state.py +718 -0
- honeybee_radiance/dynamic/stategeo.py +352 -0
- honeybee_radiance/geometry/__init__.py +13 -0
- honeybee_radiance/geometry/bubble.py +42 -0
- honeybee_radiance/geometry/cone.py +215 -0
- honeybee_radiance/geometry/cup.py +54 -0
- honeybee_radiance/geometry/cylinder.py +197 -0
- honeybee_radiance/geometry/geometrybase.py +37 -0
- honeybee_radiance/geometry/instance.py +40 -0
- honeybee_radiance/geometry/mesh.py +38 -0
- honeybee_radiance/geometry/polygon.py +174 -0
- honeybee_radiance/geometry/ring.py +214 -0
- honeybee_radiance/geometry/source.py +182 -0
- honeybee_radiance/geometry/sphere.py +178 -0
- honeybee_radiance/geometry/tube.py +46 -0
- honeybee_radiance/lib/__init__.py +1 -0
- honeybee_radiance/lib/_loadmodifiers.py +72 -0
- honeybee_radiance/lib/_loadmodifiersets.py +69 -0
- honeybee_radiance/lib/modifiers.py +58 -0
- honeybee_radiance/lib/modifiersets.py +63 -0
- honeybee_radiance/lightpath.py +204 -0
- honeybee_radiance/lightsource/__init__.py +1 -0
- honeybee_radiance/lightsource/_gendaylit.py +479 -0
- honeybee_radiance/lightsource/dictutil.py +49 -0
- honeybee_radiance/lightsource/ground.py +160 -0
- honeybee_radiance/lightsource/sky/__init__.py +7 -0
- honeybee_radiance/lightsource/sky/_skybase.py +177 -0
- honeybee_radiance/lightsource/sky/certainirradiance.py +232 -0
- honeybee_radiance/lightsource/sky/cie.py +378 -0
- honeybee_radiance/lightsource/sky/climatebased.py +501 -0
- honeybee_radiance/lightsource/sky/hemisphere.py +160 -0
- honeybee_radiance/lightsource/sky/skydome.py +113 -0
- honeybee_radiance/lightsource/sky/skymatrix.py +163 -0
- honeybee_radiance/lightsource/sky/strutil.py +34 -0
- honeybee_radiance/lightsource/sky/sunmatrix.py +212 -0
- honeybee_radiance/lightsource/sunpath.py +247 -0
- honeybee_radiance/modifier/__init__.py +3 -0
- honeybee_radiance/modifier/material/__init__.py +30 -0
- honeybee_radiance/modifier/material/absdf.py +477 -0
- honeybee_radiance/modifier/material/antimatter.py +54 -0
- honeybee_radiance/modifier/material/ashik2.py +51 -0
- honeybee_radiance/modifier/material/brtdfunc.py +81 -0
- honeybee_radiance/modifier/material/bsdf.py +292 -0
- honeybee_radiance/modifier/material/dielectric.py +53 -0
- honeybee_radiance/modifier/material/glass.py +431 -0
- honeybee_radiance/modifier/material/glow.py +246 -0
- honeybee_radiance/modifier/material/illum.py +51 -0
- honeybee_radiance/modifier/material/interface.py +49 -0
- honeybee_radiance/modifier/material/light.py +206 -0
- honeybee_radiance/modifier/material/materialbase.py +36 -0
- honeybee_radiance/modifier/material/metal.py +167 -0
- honeybee_radiance/modifier/material/metal2.py +41 -0
- honeybee_radiance/modifier/material/metdata.py +41 -0
- honeybee_radiance/modifier/material/metfunc.py +41 -0
- honeybee_radiance/modifier/material/mirror.py +340 -0
- honeybee_radiance/modifier/material/mist.py +86 -0
- honeybee_radiance/modifier/material/plasdata.py +58 -0
- honeybee_radiance/modifier/material/plasfunc.py +59 -0
- honeybee_radiance/modifier/material/plastic.py +354 -0
- honeybee_radiance/modifier/material/plastic2.py +58 -0
- honeybee_radiance/modifier/material/prism1.py +57 -0
- honeybee_radiance/modifier/material/prism2.py +48 -0
- honeybee_radiance/modifier/material/spotlight.py +50 -0
- honeybee_radiance/modifier/material/trans.py +518 -0
- honeybee_radiance/modifier/material/trans2.py +49 -0
- honeybee_radiance/modifier/material/transdata.py +50 -0
- honeybee_radiance/modifier/material/transfunc.py +53 -0
- honeybee_radiance/modifier/mixture/__init__.py +6 -0
- honeybee_radiance/modifier/mixture/mixdata.py +49 -0
- honeybee_radiance/modifier/mixture/mixfunc.py +54 -0
- honeybee_radiance/modifier/mixture/mixpict.py +52 -0
- honeybee_radiance/modifier/mixture/mixtext.py +66 -0
- honeybee_radiance/modifier/mixture/mixturebase.py +28 -0
- honeybee_radiance/modifier/modifierbase.py +40 -0
- honeybee_radiance/modifier/pattern/__init__.py +9 -0
- honeybee_radiance/modifier/pattern/brightdata.py +49 -0
- honeybee_radiance/modifier/pattern/brightfunc.py +47 -0
- honeybee_radiance/modifier/pattern/brighttext.py +81 -0
- honeybee_radiance/modifier/pattern/colordata.py +56 -0
- honeybee_radiance/modifier/pattern/colorfunc.py +47 -0
- honeybee_radiance/modifier/pattern/colorpict.py +54 -0
- honeybee_radiance/modifier/pattern/colortext.py +73 -0
- honeybee_radiance/modifier/pattern/patternbase.py +34 -0
- honeybee_radiance/modifier/texture/__init__.py +4 -0
- honeybee_radiance/modifier/texture/texdata.py +29 -0
- honeybee_radiance/modifier/texture/texfunc.py +26 -0
- honeybee_radiance/modifier/texture/texturebase.py +27 -0
- honeybee_radiance/modifierset.py +1091 -0
- honeybee_radiance/mutil.py +60 -0
- honeybee_radiance/postprocess/__init__.py +1 -0
- honeybee_radiance/postprocess/annual.py +108 -0
- honeybee_radiance/postprocess/annualdaylight.py +425 -0
- honeybee_radiance/postprocess/annualglare.py +201 -0
- honeybee_radiance/postprocess/annualirradiance.py +187 -0
- honeybee_radiance/postprocess/electriclight.py +119 -0
- honeybee_radiance/postprocess/en17037.py +261 -0
- honeybee_radiance/postprocess/leed.py +304 -0
- honeybee_radiance/postprocess/solartracking.py +90 -0
- honeybee_radiance/primitive.py +554 -0
- honeybee_radiance/properties/__init__.py +1 -0
- honeybee_radiance/properties/_base.py +390 -0
- honeybee_radiance/properties/aperture.py +197 -0
- honeybee_radiance/properties/door.py +198 -0
- honeybee_radiance/properties/face.py +123 -0
- honeybee_radiance/properties/model.py +1291 -0
- honeybee_radiance/properties/room.py +490 -0
- honeybee_radiance/properties/shade.py +186 -0
- honeybee_radiance/properties/shademesh.py +116 -0
- honeybee_radiance/putil.py +44 -0
- honeybee_radiance/reader.py +214 -0
- honeybee_radiance/sensor.py +166 -0
- honeybee_radiance/sensorgrid.py +1008 -0
- honeybee_radiance/view.py +1101 -0
- honeybee_radiance/writer.py +951 -0
- honeybee_radiance-1.66.190.dist-info/METADATA +89 -0
- honeybee_radiance-1.66.190.dist-info/RECORD +152 -0
- honeybee_radiance-1.66.190.dist-info/WHEEL +5 -0
- honeybee_radiance-1.66.190.dist-info/entry_points.txt +2 -0
- honeybee_radiance-1.66.190.dist-info/licenses/LICENSE +661 -0
- honeybee_radiance-1.66.190.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"""Radiance BSDF Material.
|
|
2
|
+
|
|
3
|
+
https://floyd.lbl.gov/radiance/refer/ray.html#BSDF
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import division
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from .absdf import aBSDF
|
|
9
|
+
from honeybee.config import folders
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BSDF(aBSDF):
|
|
13
|
+
"""Radiance BSDF material.
|
|
14
|
+
|
|
15
|
+
.. code-block:: shell
|
|
16
|
+
|
|
17
|
+
mod BSDF id
|
|
18
|
+
6+ thick BSDFfile ux uy uz funcfile transform
|
|
19
|
+
0
|
|
20
|
+
0|3|6|9
|
|
21
|
+
rfdif gfdif bfdif
|
|
22
|
+
rbdif gbdif bbdif
|
|
23
|
+
rtdif gtdif btdif
|
|
24
|
+
|
|
25
|
+
The __init__ method sets additional diffuse reflectance for front and back as well
|
|
26
|
+
as additional diffuse transmittance to 0. You can setup these values by using their
|
|
27
|
+
respective property.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
bsdf_file: Path to an xml file. Data will NOT be cached in memory.
|
|
31
|
+
identifier: Text string for a unique Material ID. Must not contain spaces
|
|
32
|
+
or special characters. This will be used to identify the object across
|
|
33
|
+
a model and in the exported Radiance files. If None, the identifier
|
|
34
|
+
will be derived from the bsdf_file name. (Default: None)
|
|
35
|
+
up_orientation: (x, y ,z) vector that sets the hemisphere that the
|
|
36
|
+
BSDF material faces. For materials that are symmetrical about
|
|
37
|
+
the face plane (like non-angled venetian blinds), this can be
|
|
38
|
+
any vector that is not perfectly normal to the face. For
|
|
39
|
+
asymmetrical materials like angled venetian blinds, this variable
|
|
40
|
+
should be coordinated with the direction the face are facing.
|
|
41
|
+
The default is set to (0.01, 0.01, 1.00), which should hopefully
|
|
42
|
+
not be perpendicular to any typical face.
|
|
43
|
+
thickness: Optional number to set the thickness of the BSDF material.
|
|
44
|
+
(default: 0).
|
|
45
|
+
modifier: Material modifier (Default: None).
|
|
46
|
+
function_file: Optional input for function file (Default: .).
|
|
47
|
+
transform: Optional transform input to to scale the thickness and reorient
|
|
48
|
+
the up vector (default: None).
|
|
49
|
+
angle_basis: BSDF file angle basis. If not provided by user honeybee tries to
|
|
50
|
+
find it by parsing BSDF file itself.
|
|
51
|
+
dependencies: A list of primitives that this primitive depends on. This
|
|
52
|
+
argument is only useful for defining advanced primitives where the
|
|
53
|
+
primitive is defined based on other primitives. (Default: [])
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
Properties:
|
|
57
|
+
* identifier
|
|
58
|
+
* display_name
|
|
59
|
+
* bsdf_file
|
|
60
|
+
* up_orientation
|
|
61
|
+
* thickness
|
|
62
|
+
* function_file
|
|
63
|
+
* transform
|
|
64
|
+
* angle_basis
|
|
65
|
+
* front_diffuse_reflectance
|
|
66
|
+
* back_diffuse_reflectance
|
|
67
|
+
* diffuse_transmittance
|
|
68
|
+
* dependencies
|
|
69
|
+
* values
|
|
70
|
+
* modifier
|
|
71
|
+
* dependencies
|
|
72
|
+
* is_modifier
|
|
73
|
+
* is_material
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
__slots__ = ('_thickness',)
|
|
77
|
+
|
|
78
|
+
# TODO(): compress file content: https://stackoverflow.com/a/15529390/4394669
|
|
79
|
+
def __init__(self, bsdf_file, identifier=None, up_orientation=None, thickness=0,
|
|
80
|
+
modifier=None, function_file='.', transform=None, angle_basis=None,
|
|
81
|
+
dependencies=None):
|
|
82
|
+
"""Create BSDF material."""
|
|
83
|
+
self.thickness = thickness or 0
|
|
84
|
+
aBSDF.__init__(self, bsdf_file, identifier, up_orientation, modifier,
|
|
85
|
+
function_file, transform, angle_basis, dependencies)
|
|
86
|
+
|
|
87
|
+
def _update_values(self):
|
|
88
|
+
"update value dictionaries."
|
|
89
|
+
n_path = os.path.normpath(self.bsdf_file).replace('\\', '/')
|
|
90
|
+
f_path = n_path if os.path.isabs(n_path) else './{}'.format(n_path)
|
|
91
|
+
self._values[0] = [
|
|
92
|
+
float(self.thickness),
|
|
93
|
+
'"{}"'.format(f_path),
|
|
94
|
+
self.up_orientation.x,
|
|
95
|
+
self.up_orientation.y,
|
|
96
|
+
self.up_orientation.z,
|
|
97
|
+
self.function_file
|
|
98
|
+
]
|
|
99
|
+
if self.transform:
|
|
100
|
+
self.values[0].append(self.transform)
|
|
101
|
+
|
|
102
|
+
if self.front_diffuse_reflectance is not None:
|
|
103
|
+
self._values[2] = list(self.front_diffuse_reflectance)
|
|
104
|
+
|
|
105
|
+
if self.back_diffuse_reflectance is not None:
|
|
106
|
+
for v in self.back_diffuse_reflectance:
|
|
107
|
+
self._values[2].append(v)
|
|
108
|
+
|
|
109
|
+
if self.diffuse_transmittance is not None:
|
|
110
|
+
for v in self.diffuse_transmittance:
|
|
111
|
+
self._values[2].append(v)
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def thickness(self):
|
|
115
|
+
"""Get or set a number for the thickness of the BSDF material (default: 0).
|
|
116
|
+
|
|
117
|
+
If a view or shadow ray hits a BSDF proxy with non-zero thickness, it will pass
|
|
118
|
+
directly through as if the surface were not there. Similar to the illum type,
|
|
119
|
+
this permits direct viewing and shadow testing of complex geometry. The BSDF is
|
|
120
|
+
used when a scattered (indirect) ray hits the surface, and any transmitted sample
|
|
121
|
+
rays will be offset by the thickness amount to avoid the hidden geometry and
|
|
122
|
+
gather samples from the other side. In this manner, BSDF surfaces can improve the
|
|
123
|
+
results for indirect scattering from complex systems without sacrificing
|
|
124
|
+
appearance or shadow accuracy. If the BSDF has transmission and back-side
|
|
125
|
+
reflection data, a parallel BSDF surface may be placed slightly less than the
|
|
126
|
+
given thickness away from the front surface to enclose the complex geometry on
|
|
127
|
+
both sides. The sign of the thickness is important, as it indicates whether the
|
|
128
|
+
proxied geometry is behind the BSDF surface (when thickness is positive) or in
|
|
129
|
+
front (when thickness is negative)
|
|
130
|
+
"""
|
|
131
|
+
return self._thickness
|
|
132
|
+
|
|
133
|
+
@thickness.setter
|
|
134
|
+
def thickness(self, value):
|
|
135
|
+
self._thickness = float(value)
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def from_primitive_dict(cls, primitive_dict):
|
|
139
|
+
"""Initialize a BSDF from a primitive dict.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
data: A dictionary in the format below.
|
|
143
|
+
|
|
144
|
+
.. code-block:: python
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
"modifier": {}, # primitive modifier (Default: None)
|
|
148
|
+
"type": "BSDF", # primitive type
|
|
149
|
+
"identifier": "", # primitive identifier
|
|
150
|
+
"display_name": "", # primitive display name
|
|
151
|
+
"values": [] # values,
|
|
152
|
+
"dependencies": []
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
"""
|
|
156
|
+
cls._dict_type_check(cls.__name__, primitive_dict)
|
|
157
|
+
modifier, dependencies = cls.filter_dict_input(primitive_dict)
|
|
158
|
+
values = primitive_dict['values'][0]
|
|
159
|
+
extra_values = primitive_dict['values'][2]
|
|
160
|
+
|
|
161
|
+
cls_ = cls(
|
|
162
|
+
thickness=values[0],
|
|
163
|
+
bsdf_file=values[1],
|
|
164
|
+
identifier=primitive_dict['identifier'],
|
|
165
|
+
up_orientation=values[2:5],
|
|
166
|
+
modifier=modifier,
|
|
167
|
+
function_file=values[5],
|
|
168
|
+
transform=values[6] if len(values) == 7 else None,
|
|
169
|
+
angle_basis=None,
|
|
170
|
+
dependencies=dependencies
|
|
171
|
+
)
|
|
172
|
+
if 'display_name' in primitive_dict and \
|
|
173
|
+
primitive_dict['display_name'] is not None:
|
|
174
|
+
cls_.display_name = primitive_dict['display_name']
|
|
175
|
+
|
|
176
|
+
# this might look redundant but it is NOT. see glass for explanation.
|
|
177
|
+
cls_.values = primitive_dict['values']
|
|
178
|
+
|
|
179
|
+
if not extra_values:
|
|
180
|
+
return cls_
|
|
181
|
+
|
|
182
|
+
values_length = len(extra_values)
|
|
183
|
+
assert values_length in (3, 6, 9), \
|
|
184
|
+
'Length of real values should be 3, 6 or 9 not %d.' % values_length
|
|
185
|
+
|
|
186
|
+
if values_length == 3:
|
|
187
|
+
cls_.front_diffuse_reflectance = extra_values
|
|
188
|
+
elif values_length == 6:
|
|
189
|
+
cls_.front_diffuse_reflectance = extra_values[:3]
|
|
190
|
+
cls_.back_diffuse_reflectance = extra_values[3:]
|
|
191
|
+
else:
|
|
192
|
+
cls_.front_diffuse_reflectance = extra_values[:3]
|
|
193
|
+
cls_.back_diffuse_reflectance = extra_values[3:6]
|
|
194
|
+
cls_.diffuse_transmittance = extra_values[6:]
|
|
195
|
+
|
|
196
|
+
return cls_
|
|
197
|
+
|
|
198
|
+
@classmethod
|
|
199
|
+
def from_dict(cls, data, folder=None):
|
|
200
|
+
"""Initialize a BSDF from a dictionary.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
data: A dictionary in the format below.
|
|
204
|
+
folder: Path to a destination folder to save the bsdf file.
|
|
205
|
+
|
|
206
|
+
.. code-block:: python
|
|
207
|
+
|
|
208
|
+
{
|
|
209
|
+
"modifier": {}, # material modifier (Default: None)
|
|
210
|
+
"type": "BSDF", # Material type
|
|
211
|
+
"identifier": "", # Material identifer
|
|
212
|
+
"display_name": "" # Material display name
|
|
213
|
+
"up_orientation": [number, number, number],
|
|
214
|
+
"thickness": float, # default: 0
|
|
215
|
+
"function_file": string, # default: '.'
|
|
216
|
+
"transform": string, # default: None
|
|
217
|
+
"bsdf_data": string, # bsdf file data as string
|
|
218
|
+
"front_diffuse_reflectance": [number, number, number], # optional
|
|
219
|
+
"back_diffuse_reflectance": [number, number, number], # optional
|
|
220
|
+
"diffuse_transmittance": [number, number, number] # optional
|
|
221
|
+
}
|
|
222
|
+
"""
|
|
223
|
+
cls._dict_type_check(cls.__name__, data)
|
|
224
|
+
modifier, dependencies = cls.filter_dict_input(data)
|
|
225
|
+
|
|
226
|
+
# check folder and create it if it does not exist
|
|
227
|
+
folder = os.path.join(folders.default_simulation_folder, 'BSDF') \
|
|
228
|
+
if folder is None else folder
|
|
229
|
+
if not os.path.isdir(folder):
|
|
230
|
+
os.makedirs(folder)
|
|
231
|
+
|
|
232
|
+
fp = os.path.join(folder, '%s.xml' % data['identifier'])
|
|
233
|
+
# write to xml file
|
|
234
|
+
cls.decompress_to_file(data['bsdf_data'], fp)
|
|
235
|
+
|
|
236
|
+
cls_ = cls(
|
|
237
|
+
bsdf_file=fp,
|
|
238
|
+
identifier=data['identifier'],
|
|
239
|
+
up_orientation=data['up_orientation'],
|
|
240
|
+
thickness=data['thickness'],
|
|
241
|
+
modifier=modifier,
|
|
242
|
+
dependencies=dependencies
|
|
243
|
+
)
|
|
244
|
+
if 'display_name' in data and data['display_name'] is not None:
|
|
245
|
+
cls_.display_name = data['display_name']
|
|
246
|
+
|
|
247
|
+
if 'front_diffuse_reflectance' in data:
|
|
248
|
+
cls_.front_diffuse_reflectance = data['front_diffuse_reflectance']
|
|
249
|
+
if 'back_diffuse_reflectance' in data:
|
|
250
|
+
cls_.back_diffuse_reflectance = data['back_diffuse_reflectance']
|
|
251
|
+
if 'diffuse_transmittance' in data:
|
|
252
|
+
cls_.diffuse_transmittance = data['diffuse_transmittance']
|
|
253
|
+
|
|
254
|
+
return cls_
|
|
255
|
+
|
|
256
|
+
def to_dict(self):
|
|
257
|
+
"""Convert BSDF material to a dictionary."""
|
|
258
|
+
bsdf_data = self.compress_file(self.bsdf_file)
|
|
259
|
+
|
|
260
|
+
bsdf_dict = {
|
|
261
|
+
'modifier': self.modifier.to_dict(),
|
|
262
|
+
'type': 'BSDF',
|
|
263
|
+
'identifier': self.identifier,
|
|
264
|
+
'up_orientation': self.up_orientation.to_array(),
|
|
265
|
+
'thickness': self.thickness,
|
|
266
|
+
'function_file': self.function_file,
|
|
267
|
+
'transform': self.transform,
|
|
268
|
+
'bsdf_data': bsdf_data,
|
|
269
|
+
'dependencies': [dep.to_dict() for dep in self.dependencies]
|
|
270
|
+
}
|
|
271
|
+
if self._display_name is not None:
|
|
272
|
+
bsdf_dict['display_name'] = self.display_name
|
|
273
|
+
|
|
274
|
+
if self.front_diffuse_reflectance:
|
|
275
|
+
bsdf_dict['front_diffuse_reflectance'] = self.front_diffuse_reflectance
|
|
276
|
+
if self.back_diffuse_reflectance:
|
|
277
|
+
bsdf_dict['back_diffuse_reflectance'] = self.back_diffuse_reflectance
|
|
278
|
+
if self.diffuse_transmittance:
|
|
279
|
+
bsdf_dict['diffuse_transmittance'] = self.diffuse_transmittance
|
|
280
|
+
|
|
281
|
+
return bsdf_dict
|
|
282
|
+
|
|
283
|
+
def __copy__(self):
|
|
284
|
+
mod, depend = self._dup_mod_and_depend()
|
|
285
|
+
new_bsdf = self.__class__(
|
|
286
|
+
self.bsdf_file, self.identifier, self.up_orientation, self.thickness, mod,
|
|
287
|
+
self.function_file, self.transform, self.angle_basis, depend)
|
|
288
|
+
new_bsdf._front_diffuse_reflectance = self._front_diffuse_reflectance
|
|
289
|
+
new_bsdf._back_diffuse_reflectance = self._back_diffuse_reflectance
|
|
290
|
+
new_bsdf._diffuse_transmittance = self._diffuse_transmittance
|
|
291
|
+
new_bsdf._display_name = self._display_name
|
|
292
|
+
return new_bsdf
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Radiance Dielectric Material.
|
|
2
|
+
|
|
3
|
+
http://radsite.lbl.gov/radiance/refer/ray.html#Dielectric
|
|
4
|
+
"""
|
|
5
|
+
from .materialbase import Material
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# TODO: Implement the class. It's currently only a generic Radiance Primitive
|
|
9
|
+
class Dielectric(Material):
|
|
10
|
+
"""Radiance Dielectric Material.
|
|
11
|
+
|
|
12
|
+
A dielectric material is transparent, and it refracts light as well as reflecting it.
|
|
13
|
+
Its behavior is determined by the index of refraction and transmission coefficient in
|
|
14
|
+
each wavelength band per unit length. Common glass has a index of refraction (n)
|
|
15
|
+
around 1.5, and a transmission coefficient of roughly 0.92 over an inch. An
|
|
16
|
+
additional number, the Hartmann constant, describes how the index of refraction
|
|
17
|
+
changes as a function of wavelength. It is usually zero. (A pattern modifies only the
|
|
18
|
+
refracted value.)
|
|
19
|
+
|
|
20
|
+
.. code-block:: shell
|
|
21
|
+
|
|
22
|
+
mod dielectric id
|
|
23
|
+
0
|
|
24
|
+
0
|
|
25
|
+
5 rtn gtn btn n hc
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
identifier: Text string for a unique Material ID. Must not contain spaces
|
|
29
|
+
or special characters. This will be used to identify the object across
|
|
30
|
+
a model and in the exported Radiance files.
|
|
31
|
+
modifier: Modifier. It can be primitive, mixture, texture or pattern.
|
|
32
|
+
(Default: None).
|
|
33
|
+
values: An array 3 arrays for primitive data. Each of the 3 sub-arrays
|
|
34
|
+
refer to a line number in the radiance primitive definitions and the
|
|
35
|
+
values in each array correspond to values occurring within each line.
|
|
36
|
+
is_opaque: A boolean to indicate whether this primitive is opaque.
|
|
37
|
+
dependencies: A list of primitives that this primitive depends on. This
|
|
38
|
+
argument is only useful for defining advanced primitives that are
|
|
39
|
+
defined based on other primitives. (Default: []).
|
|
40
|
+
|
|
41
|
+
Properties:
|
|
42
|
+
* identifier
|
|
43
|
+
* display_name
|
|
44
|
+
* values
|
|
45
|
+
* modifier
|
|
46
|
+
* dependencies
|
|
47
|
+
* is_modifier
|
|
48
|
+
* is_material
|
|
49
|
+
* is_opaque
|
|
50
|
+
"""
|
|
51
|
+
__slots__ = ()
|
|
52
|
+
|
|
53
|
+
pass
|