def test_plastic(self):
        """Checking Plastic."""
        plastic = Plastic("grey", 0.1, 0.1, 0.1, 0.1, 0.001)

        plastic_tuple = tuple(plastic.to_rad_string().split())
        assert tuple(map(self.safe_cast_float, plastic_tuple)) == \
            ('void', 'plastic', 'grey', 0, 0, 5, 0.100, 0.100,
             0.100, 0.100, 0.001)
Beispiel #2
0
 def to_hb(self) -> RadianceProperties:
     """ Convert Material into Honeybee Radiance material property object """
     return RadianceProperties(
         material=Plastic(self.name,
                          r_reflectance=self.reflectivity,
                          g_reflectance=self.reflectivity,
                          b_reflectance=self.reflectivity))
    Args:
        _name: Material name as a text string.
        _reflect_: Diffuse reflectance as a number between 0 and 1.
        _spec_: Fraction of reflected light that is specular. The reflected specularity
            of common uncoated glass is around .06, Matte = suggested min 0,
            Satin = suggested max 0.07 (Default: 0). Specularity fractions
            greater than 0.1 are not realistic (Default: 0).
        _rough_: Roughness is specified as the rms slope of surface facets.
            A value of 0 corresponds to a perfectly smooth surface, and a 
            value of 1 would be a very rough surface. Roughness values 
            greater than 0.2 are not very realistic. (Default: 0).
    Returns:
        material: Radiance opaque material
"""

ghenv.Component.Name = "HoneybeePlus_Radiance Opaque Material"
ghenv.Component.NickName = 'radOpaqueMat'
ghenv.Component.Message = 'VER 0.0.05\nOCT_22_2018'
ghenv.Component.Category = "HoneybeePlus"
ghenv.Component.SubCategory = '01 :: Daylight :: Materials'
ghenv.Component.AdditionalHelpFromDocStrings = "1"

try:
    from honeybee.radiance.material.plastic import Plastic
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

if _name:
    _reflect_ = 0.35 if _reflect_ is None else _reflect_
    material = Plastic.by_single_reflect_value(_name, _reflect_, _spec_,
                                               _rough_)
Beispiel #4
0
                                 b_transmittance=0.9,
                                 refraction_index=1.52)
 glass_material_skylight = Glass(
     "GlassMaterialSkylight",
     r_transmittance=config["glass_visible_transmittance"],
     g_transmittance=config["glass_visible_transmittance"],
     b_transmittance=config["glass_visible_transmittance"],
     refraction_index=1.52)
 air_wall_material = Glass("AirWallMaterial",
                           r_transmittance=0,
                           g_transmittance=0,
                           b_transmittance=0,
                           refraction_index=1)
 wall_material = Plastic("WallMaterial",
                         r_reflectance=config["wall_reflectivity"],
                         g_reflectance=config["wall_reflectivity"],
                         b_reflectance=config["wall_reflectivity"],
                         specularity=0,
                         roughness=0)
 ceiling_material = Plastic("CeilingMaterial",
                            r_reflectance=config["ceiling_reflectivity"],
                            g_reflectance=config["ceiling_reflectivity"],
                            b_reflectance=config["ceiling_reflectivity"],
                            specularity=0,
                            roughness=0)
 floor_material = Plastic("FloorMaterial",
                          r_reflectance=config["floor_reflectivity"],
                          g_reflectance=config["floor_reflectivity"],
                          b_reflectance=config["floor_reflectivity"],
                          specularity=0,
                          roughness=0)
 print("Materials defined from properties in {0:}".format(
Beispiel #5
0
    Args:
        _name: Material name
        _rRef_: Diffuse reflectance for red channel
        _gRef_: Diffuse reflectance for green channel
        _bRef_: Diffuse reflectance for blue channel
        _spec_: Specularity values above 0.1 are uncommon
        _rough_: Roughness values above 0.2 are uncommon
    Returns:
        readMe!: Reports, errors, warnings, etc.
        material: Radiance opaque material
"""

ghenv.Component.Name = "HoneybeePlus_Radiance Opaque Material 3"
ghenv.Component.NickName = 'radOpaqueMaterial3'
ghenv.Component.Message = 'VER 0.0.05\nMAR_14_2018'
ghenv.Component.Category = "HoneybeePlus"
ghenv.Component.SubCategory = '01 :: Daylight :: Materials'
ghenv.Component.AdditionalHelpFromDocStrings = "1"

try:
    from honeybee.radiance.material.plastic import Plastic
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

if _name:
    _rRef_ = _rRef_ or 0.35
    _gRef_ = _gRef_ or 0.35
    _bRef_ = _bRef_ or 0.35
    material = Plastic(_name, _rRef_, _gRef_, _bRef_, _spec_, _rough_)
        _b_ref_: Diffuse reflectance for blue channel
        _spec_: Fraction of reflected light that is specular. The reflected specularity
            of common uncoated glass is around .06, Matte = suggested min 0,
            Satin = suggested max 0.07 (Default: 0). Specularity fractions
            greater than 0.1 are not realistic (Default: 0).
        _rough_:  Roughness is specified as the rms slope of surface facets.
            A value of 0 corresponds to a perfectly smooth surface, and a 
            value of 1 would be a very rough surface. Roughness values 
            greater than 0.2 are not very realistic. (Default: 0).
    Returns:
        material: Radiance opaque material
"""

ghenv.Component.Name = "HoneybeePlus_Radiance Opaque Material 3"
ghenv.Component.NickName = 'radOpaqueMat3'
ghenv.Component.Message = 'VER 0.0.05\nOCT_22_2018'
ghenv.Component.Category = "HoneybeePlus"
ghenv.Component.SubCategory = '01 :: Daylight :: Materials'
ghenv.Component.AdditionalHelpFromDocStrings = "1"

try:
    from honeybee.radiance.material.plastic import Plastic
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

if _name:
    r_reflectance = 0 if _r_ref_ is None else _r_ref_
    g_reflectance = 0 if _g_ref_ is None else _g_ref_
    b_reflectance = 0 if _b_ref_ is None else _b_ref_
    material = Plastic(_name, _r_ref_, _g_ref_, _b_ref_, _spec_, _rough_)
 def create_opaque_material(name='default', reflect=0, spec=0, rough=0):
     material = Plastic.by_single_reflect_value(name, reflect, spec, rough)
     return material