def test_bsdf(self): """Checking BSDF.""" bsdf = BSDF('tests/assets/clear.xml') # bsdf with no function bsdf_tuple = tuple(bsdf.to_rad_string().split()) assert tuple(map(self.safe_cast_float, bsdf_tuple)) == \ ('void', 'BSDF', 'clear', 6, 0.000, 'tests/assets/clear.xml', 0.010, 0.010, 1.000, '.', 0, 0)
def test_bsdf_from_string(self): """Checking BSDF.""" bsdf_string = """ void BSDF clear 6 0.0 tests/assets/clear.xml 0.01 0.01 1.0 . 0 0 """ bsdf = BSDF.from_string(bsdf_string) # bsdf with no function bsdf_tuple = tuple(bsdf.to_rad_string().split()) assert tuple(map(self.safe_cast_float, bsdf_tuple)) == \ ('void', 'BSDF', 'clear', 6, 0.000, 'tests{0}assets{0}clear.xml'.format(os.sep), 0.010, 0.010, 1.000, '.', 0, 0)
def test_tensortree_bsdf(self): """Checking BSDF.""" bsdf = BSDF('tests/assets/b00.xml') assert bsdf.angle_basis == 'TensorTree'
_upOrientation_: (x, y ,z) vector that sets the hemisphere that the BSDF material faces. For materials that are symmetrical about the HBSrf plane (like non-angled venitian blinds), this can be any vector that is not perfectly normal to the HBSrf. For asymmetrical materials like angled veneitan blinds, this variable should be coordinated with the direction the HBSrfs are facing. The default is set to (0.01, 0.01, 1.00), which should hopefully not be perpendicular to any typical HBSrf. _upVector_: Optional number to set the thickness of the BSDF material. (default: 0) Returns: readMe!: Reports, errors, warnings, etc. material: Radiance BSDF material """ ghenv.Component.Name = "HoneybeePlus_Radiance BSDF Material" ghenv.Component.NickName = 'BSDFMaterial' ghenv.Component.Message = 'VER 0.0.05\nMAR_14_2018' ghenv.Component.Category = "HoneybeePlus" ghenv.Component.SubCategory = '01 :: Daylight :: Materials' ghenv.Component.AdditionalHelpFromDocStrings = "2" try: from honeybee.radiance.material.bsdf import BSDF except ImportError as e: raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e)) if _xmlfile: name = None # will be generated from xml file name material = BSDF(_xmlfile, name, _upVector_, thickness_)
_up_vec_: (x, y ,z) vector that sets the hemisphere that the BSDF material faces. For materials that are symmetrical about the HBSrf plane (like non-angled venitian blinds), this can be any vector that is not perfectly normal to the HBSrf. For asymmetrical materials like angled veneitan blinds, this variable should be coordinated with the direction the HBSrfs are facing. The default is set to (0.01, 0.01, 1.00), which should hopefully not be perpendicular to any typical HBSrf. thickness_: Optional number to set the thickness of the BSDF material. (default: 0) Returns: readMe!: Reports, errors, warnings, etc. material: Radiance BSDF material """ ghenv.Component.Name = "HoneybeePlus_Radiance BSDF Material" ghenv.Component.NickName = 'radBSDFMat' ghenv.Component.Message = 'VER 0.0.05\nOCT_22_2018' ghenv.Component.Category = "HoneybeePlus" ghenv.Component.SubCategory = '01 :: Daylight :: Materials' ghenv.Component.AdditionalHelpFromDocStrings = "2" try: from honeybee.radiance.material.bsdf import BSDF except ImportError as e: raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e)) if _xmlfile: name = None # will be generated from xml file name material = BSDF(_xmlfile, name, _up_vec_, thickness_)