honeybee_radiance.dynamic.stategeo module¶
Dynamic geometry that can be assigned to individual states.
- class honeybee_radiance.dynamic.stategeo.StateGeometry(identifier, geometry, modifier=None)[source]¶
Bases:
object
A single planar geometry that can be assigned to Radiance states.
- Parameters:
identifier – Text string for a unique geometry ID. Must not contain any spaces or special characters.
geometry – A ladybug-geometry Face3D.
modifier – A Honeybee Radiance Modifier object for the geometry. If None, it will be the Generic Exterior Shade modifier in the lib. (Default: None).
- Properties:
identifier
display_name
geometry
modifier
modifier_direct
parent
has_parent
vertices
normal
center
area
- classmethod from_dict(data)[source]¶
Initialize a StateGeometry from a dictionary.
Note that the dictionary must be a non-abridged version for this classmethod to work.
- Parameters:
data – A dictionary representation of an StateGeometry with the format below.
{ 'type': 'StateGeometry', 'identifier': str, # Text for the unique object identifier 'display_name': str, # Optional text for the display name 'geometry': {}, # A ladybug_geometry Face3D dictionary 'modifier': {}, # A Honeybee Radiance Modifier dictionary 'modifier_direct': {} # A Honeybee Radiance Modifier dictionary }
- classmethod from_dict_abridged(data, modifiers)[source]¶
Create StateGeometry from an abridged dictionary.
- Parameters:
data – A dictionary representation of StateGeometryAbridged with the format below.
modifiers – A dictionary of modifiers with modifier identifiers as keys, which will be used to re-assign modifiers.
{ 'type': 'StateGeometryAbridged', 'identifier': str, # Text for the unique object identifier 'display_name': str, # Optional text for the display name 'geometry': {}, # A ladybug_geometry Face3D dictionary 'modifier': str # A Honeybee Radiance Modifier identifier 'modifier_direct': str # A Honeybee Radiance Modifier identifier }
- classmethod from_vertices(identifier, vertices, modifier=None)[source]¶
Create StateGeometry from vertices with each vertex as an iterable of 3 floats.
Note that this method is not recommended for a geometry with one or more holes since the distinction between hole vertices and boundary vertices cannot be derived from a single list of vertices.
- Parameters:
identifier – Text string for a unique geometry ID. Must not contain any spaces or special characters.
vertices – A flattened list of 3 or more vertices as (x, y, z).
modifier – A Honeybee Radiance Modifier object for the geometry. If None, it will be the Generic Exterior Shade modifier in the lib. (Default: None).
- move(moving_vec)[source]¶
Move this StateGeometry along a vector.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)[source]¶
Reflect this StateGeometry across a plane.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate(axis, angle, origin)[source]¶
Rotate this StateGeometry by a certain angle around an axis and origin.
- 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 this StateGeometry counterclockwise in the XY plane by a certain angle.
- 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 this StateGeometry by a factor from an origin point.
- 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]¶
Return StateGeometry as 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)[source]¶
Generate a RAD string representation of this StateGeometry.
Note that the resulting string lacks modifiers.
- Parameters:
direct – Boolean to note whether to write the “direct” version of the state, which will have the modifier_direct applied. (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 area¶
Get the area of the geometry.
- property center¶
Get a ladybug_geometry Point3D for the center of the geometry.
Note that this is the center of the bounding rectangle around this geometry and not the area centroid.
- property display_name¶
Get or set a string for the object name without any character restrictions.
If not set, this will be equal to the identifier.
- property geometry¶
Get a ladybug_geometry Face3D object representing the Shade.
- property has_parent¶
Get a boolean noting whether this StateGeometry has a parent State.
- property identifier¶
Get a text string for the unique object identifer.
This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, rad). As such, this property is used to reference the object across a Model.
- property is_opaque¶
Boolean noting whether this geomtry has an opaque modifier.
- property modifier¶
Get or set the object modifier.
- property modifier_direct¶
Get or set a modifier to be used in direct solar studies.
If None, this will be a completely black material if the object’s modifier is opaque and will be equal to the modifier if the object’s modifier is non-opaque.
- property normal¶
Get a ladybug_geometry Vector3D for the direction the geometry is pointing.
- property parent¶
Get the parent State if assigned. None if not assigned.
- property vertices¶
Get a list of vertices for the geometry (in counter-clockwise order).