honeybee_plus.radiance.radfile module¶
Radiance file.
Create, modify and generate radiance files from a collection of hbobjects.
-
class
honeybee_plus.radiance.radfile.
RadFile
(hb_surfaces, additional_materials=None)[source]¶ Bases:
object
Radiance file.
Create, modify and generate radiance files from a collection of hbobjects. You can also use this class for a single HBSurface or HBZone to get to_rad_string.
-
hb_surfaces
¶ A collection of honeybee surfaces.
-
additional_materials
¶ Additional radiance material objects that will be added on top of the file.
-
additional_materials
¶
-
static
copy_and_replace_xml_files
(material_string, bsdf_materials, target_folder)[source]¶ Find and replace xml files full path and copy XML files under bsdf folder.
The root folder in Radiance is the place that commands are executed which in honeybee is the root so the relative path is scene/bsdf this will make this mathod fairly inflexible.
- Parameters
material_string – A joined string of radiance materials.
bsdf_materials – A collection of BSDF materials.
target_folder – The study folder where the materials will be written.
-
geometries
(mode=1, join=False, flipped=False)[source]¶ Get geometry as a list of radiance strings.
- Parameters
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
join – Set to True to join the output strings (Default: False).
flipped – Flip the surface geometry.
-
static
get_surface_rad_string
(surface, flipped=False)[source]¶ Get the polygon definition for a honeybee surface.
This is a static method. For the full string try geometries method.
-
hb_surfaces
¶
-
materials
(mode=1, join=False, blacked=False, glowed=False)[source]¶ Get materials as a list of radiance strings.
- Parameters
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
join – Set to True to join the output strings (Default: False).
blacked – If True materials will all be set to plastic 0 0 0 0 0.
-
radiance_material_names
(mode=1)[source]¶ Get list of material names.
- Parameters
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
-
to_rad_string
(mode=1, include_materials=True, flipped=False, blacked=False, glowed=False)[source]¶ Get full radiance file as a string.
- Parameters
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
include_materials – Set to False if you only want the geometry definition (default:True).
flipped – Flip the surface geometry.
blacked – If True materials will all be set to plastic 0 0 0 0 0.
-
write
(folder, filename, mode=1, include_materials=True, flipped=False, blacked=False, glowed=False, mkdir=False)[source]¶ write materials and geometries to a file.
- Parameters
folder – Target folder.
filename – File name and extension as a string.
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
include_materials – Set to False if you only want the geometry definition (default:True).
flipped – Flip the surface geometry.
blacked – If True materials will all be set to plastic 0 0 0 0 0.
mkdir – Create the folder if does not exist already.
-
write_geometries
(folder, filename, mode=1, flipped=False, mkdir=False)[source]¶ write geometries to a file. :param folder: Target folder. :param filename: File name and extension as a string. :param mode: An integer 0-2 (Default: 1)
0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
- Parameters
flipped – Flip the surface geometry.
mkdir – Create the folder if does not exist already.
-
write_geometries_blacked
(folder, filename, mode=0, flipped=False, mkdir=False)[source]¶ Write all the surfaces to a file with BlackMaterial.
Use this method to write objects like window-groups.
-
write_geometries_glowed
(folder, filename, mode=0, flipped=False, mkdir=False)[source]¶ Write all the surfaces to a file with WhiteGlow.
Use this method to write objects like window-groups.
-
write_materials
(folder, filename, mode=1, blacked=False, glowed=False, mkdir=False)[source]¶ Write materials to a file.
- Parameters
folder – Target folder.
filename – File name and extension as a string.
mode – An integer 0-2 (Default: 1) 0 - Do not include children surfaces. 1 - Include children surfaces. 2 - Only children surfaces.
include_materials – Set to False if you only want the geometry definition (default:True).
flipped – Flip the surface geometry.
blacked – If True materials will all be set to plastic 0 0 0 0 0 0 0.
glowed – If True materials will all be set to glow 0 0 1 1 1 0. You can either use blacked or glowed.
mkdir – Create the folder if does not exist already.
-