honeybee_radiance.dynamic.state module

Object representing a single state for a dynamic object.

class honeybee_radiance.dynamic.state.RadianceShadeState(modifier=None, shades=None)[source]

Bases: _RadianceState

Object representing a single state for a dynamic Shade.

Parameters
  • modifier – A Honeybee Radiance Modifier object to be applied to this state’s parent in this state. This can be used to change the transmittance of deciduous trees, change the modifier of a ground surface to account for snow reflectance, etc. If None, it will be the parent’s default modifier.

  • shades – An optional array of StateGeometry objects to be included with this state. The StateGeometry objects cannot already have another parent state.

Properties:
  • modifier

  • shades

  • modifier_direct

  • parent

  • has_parent

ToString()
add_shade(shade)

Add a Shade object to this state.

Parameters

shade – A Shade object to add to the this state.

add_shades(shades)

Add an array of Shade objects to this state.

Parameters

shades – An array of Shade objects to add to the this state.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create RadianceShadeState from a dictionary.

Note that the dictionary must be a non-abridged version for this classmethod to work.

Parameters

data – A dictionary representation of RadianceShadeState with the format below.

{
'type': 'RadianceShadeState',
'modifier': {},  # A Honeybee Radiance Modifier dictionary
'shades': [],  # A list of StateGeometry dictionaries
'modifier_direct': {}  # A Honeybee Radiance Modifier dictionary
}
classmethod from_dict_abridged(data, modifiers)[source]

Create RadianceShadeState from an abridged dictionary.

Parameters
  • data – A dictionary representation of RadianceShadeStateAbridged with the format below.

  • modifiers – A dictionary of modifiers with modifier identifiers as keys, which will be used to re-assign modifiers.

{
'type': 'RadianceShadeStateAbridged',
'modifier': str,  # An identifier of a honeybee-radiance modifier
'shades': [],  # A list of abridged StateGeometry dictionaries
'modifier_direct': str  # An identifier of a honeybee-radiance modifier
}
move(moving_vec)

Move all shades assigned to this state along a vector.

Parameters

moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the shades.

reflect(plane)

Reflect all shades assigned to this state across a plane.

Parameters

plane – A ladybug_geometry Plane across which the object will be reflected.

remove_shades()

Remove all shades assigned to this object.

rotate(axis, angle, origin)

Rotate all shades assigned to this state.

Parameters
  • axis – A ladybug_geometry Vector3D axis representing the axis of rotation.

  • angle – An angle for rotation in degrees.

  • origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.

rotate_xy(angle, origin)

Rotate all shades counterclockwise in the world XY plane.

Parameters
  • angle – An angle in degrees.

  • origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.

scale(factor, origin=None)

Scale all shades assigned to this state by a factor.

Parameters
  • factor – A number representing how much the object should be scaled.

  • origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).

to_dict(abridged=False)[source]

Convert RadianceShadeState to a dictionary.

Parameters

abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.

to_radiance(direct=False, minimal=False)

Generate a RAD string representation of this state.

Note that the resulting string lacks modifiers but includes both the parent geometry and the geometry of any shades.

Parameters
  • direct – Boolean to note whether to write the “direct” version of the state, which will have the modifier_direct applied to the parent of the state and use the modifier_blk assigned to each of the shades. (Default: False)

  • minimal – Boolean to note whether the radiance string should be written in a minimal format (with spaces instead of line breaks). Default: False.

property has_parent

Get a boolean noting whether this State has a parent.

property modifier

Get or set the modifier to be applied to the parent in this state.

property modifier_direct

Get or set a modifier for the parent to be used in direct studies.

If None, it will be the same as the modifier of this state if that modifier is nonopaque. Otherwise, it will be the modifier_blk of the parent.

property parent

Get the parent of this State if assigned. None if not assigned.

property shades

Get or set an array of StateGeometry objects to be included with this state.

The StateGeometry objects cannot already have another parent state.

class honeybee_radiance.dynamic.state.RadianceSubFaceState(modifier=None, shades=None)[source]

Bases: _RadianceState

Object representing a single state for a dynamic Aperture or Door.

Parameters
  • modifier – A Honeybee Radiance Modifier object to be applied to this state’s parent in this state. This is used to swap out the modifier in multi-phase studies. If None, it will be the parent’s default modifier.

  • shades – An optional array of StateGeometry objects to be included with this state. The StateGeometry objects cannot already have another parent state.

Properties:
  • modifier

  • shades

  • modifier_direct

  • vmtx_geometry

  • dmtx_geometry

  • mtxs_default

  • parent

  • has_parent

ToString()
add_shade(shade)

Add a Shade object to this state.

Parameters

shade – A Shade object to add to the this state.

add_shades(shades)

Add an array of Shade objects to this state.

Parameters

shades – An array of Shade objects to add to the this state.

dmtx_to_radiance(minimal=False)[source]

Generate a RAD string representation of this state’s dmtx.

The resulting string lacks modifiers and only includes the dmtx_geometry.

Parameters

minimal – Boolean to note whether the radiance string should be written in a minimal format (with spaces instead of line breaks). Default: False.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create RadianceSubFaceState from a dictionary.

Note that the dictionary must be a non-abridged version for this classmethod to work.

Parameters

data – A dictionary representation of RadianceSubFaceState with the format below.

{
'type': 'RadianceSubFaceState',
'modifier': {},  # A Honeybee Radiance Modifier dictionary
'shades': [],  # A list of abridged StateGeometry dictionaries
'modifier_direct': {},  # A Honeybee Radiance Modifier dictionary
'vmtx_geometry': {},  # A Face3D for the view matrix geometry
'dmtx_geometry': {}  # A Face3D for the daylight matrix geometry
}
classmethod from_dict_abridged(data, modifiers)[source]

Create RadianceSubFaceState from an abridged dictionary.

Note that the dictionary must be a non-abridged version for this classmethod to work.

Parameters
  • data – A dictionary representation of RadianceSubFaceStateAbridged with the format below.

  • modifiers – A dictionary of modifiers with modifier identifiers as keys, which will be used to re-assign modifiers.

{
'type': 'RadianceSubFaceStateAbridged',
'modifier': str,  # An identifier of a honeybee-radiance modifier
'shades': [],  # A list of abridged StateGeometry dictionaries
'modifier_direct': str,  # An identifier of a honeybee-radiance modifier
'vmtx_geometry': {},  # A Face3D for the view matrix geometry
'dmtx_geometry': {}  # A Face3D for the daylight matrix geometry
}
gen_geo_from_dmtx_offset(offset)[source]

Auto-generate the dmtx_geometry using an offset from the parent geometry.

Parameters

offset – A number for the offset of the dmtx layer from the parent geometry.

gen_geo_from_vmtx_offset(offset)[source]

Auto-generate the vmtx_geometry using an offset from the parent geometry.

Parameters

offset – A number for the offset of the vmtx layer from the parent geometry.

gen_geos_from_tmtx_thickness(thickness)[source]

Auto-generate the vmtx_geometry and dmtx_geometry using a tmtx thickness.

Parameters

thickness – A number for the thickness of the tmtx layer. The state’s vmtx_geometry will be set to the the parent geometry moved half of this thickness inward. The dmtx_geometry will be set to the parent geometry moved half of this thickness outward.

move(moving_vec)[source]

Move all shades and mtx geometry assigned to this state along a vector.

Parameters

moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the shades.

reflect(plane)[source]

Reflect all shades and mtx geometry assigned to this state across a plane.

Parameters

plane – A ladybug_geometry Plane across which the object will be reflected.

remove_shades()

Remove all shades assigned to this object.

rotate(axis, angle, origin)[source]

Rotate all shades and mtx geometry assigned to this state.

Parameters
  • axis – A ladybug_geometry Vector3D axis representing the axis of rotation.

  • angle – An angle for rotation in degrees.

  • origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.

rotate_xy(angle, origin)[source]

Rotate all shades and mtx geometry counterclockwise in the world XY plane.

Parameters
  • angle – An angle in degrees.

  • origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.

scale(factor, origin=None)[source]

Scale all shades and mtx geometry assigned to this state by a factor.

Parameters
  • factor – A number representing how much the object should be scaled.

  • origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).

to_dict(abridged=False)[source]

Convert RadianceSubFaceState to a dictionary.

Parameters

abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.

to_radiance(direct=False, minimal=False)

Generate a RAD string representation of this state.

Note that the resulting string lacks modifiers but includes both the parent geometry and the geometry of any shades.

Parameters
  • direct – Boolean to note whether to write the “direct” version of the state, which will have the modifier_direct applied to the parent of the state and use the modifier_blk assigned to each of the shades. (Default: False)

  • minimal – Boolean to note whether the radiance string should be written in a minimal format (with spaces instead of line breaks). Default: False.

vmtx_to_radiance(modifier=void glow white_glow 0 0 4 1.0 1.0 1.0 0.0, minimal=False)[source]

Generate a RAD string representation of this state’s vmtx.

The resulting string lacks modifiers and only includes the vmtx_geometry.

Parameters
  • modifier – A modifier assigned to the vmtx_geometry. (Default: white_glow)

  • minimal – Boolean to note whether the radiance string should be written in a minimal format (spaces instead of line breaks). (Default: False)

property dmtx_geometry

Get or set a Face3D to be used for the outward-facing dmtx file.

If None, it will be a flipped (inward-facing) version of this state’s parent. Note that this property is only used in 3-phase and 5-phase studies and its usual purpose is to account for thickness of the tmtx (BSDF) layer. Also note that the gen_geo_from_dmtx_offset or gen_geos_from_tmtx_thickness methods can be used to automatically generate this geometry without the need to set it here.

property has_parent

Get a boolean noting whether this State has a parent.

property modifier

Get or set the modifier to be applied to the parent in this state.

property modifier_direct

Get or set a modifier for the parent to be used in direct studies.

If None, it will be the same as the modifier of this state. This property is only used in 2-phase and 5-phase studies and should usually be left as None in 2-phase studies. In 5-phase studies, this will be used for the 5th phase.

property mtxs_default

Get a boolean noting whether the vmtx_geometry and dmtx_geometry are None.

This indicates that the vmtx_geometry and dmtx_geometry are both just a flipped version of the parent geometry.

property parent

Get the parent of this State if assigned. None if not assigned.

property shades

Get or set an array of StateGeometry objects to be included with this state.

The StateGeometry objects cannot already have another parent state.

property vmtx_geometry

Get or set a Face3D to be used for the inward-facing vmtx file.

If None, it will be a flipped (inward-facing) version of this state’s parent. Note that this property is only used in 3-phase and 5-phase studies and its usual purpose is to account for thickness of the tmtx (BSDF) layer. Also note that the gen_geo_from_vmtx_offset or gen_geos_from_tmtx_thickness methods can be used to automatically generate this geometry without the need to set it here.