dragonfly.windowparameter module

Window Parameters with instructions for generating windows.

class dragonfly.windowparameter.DetailedWindows(polygons, are_doors=None)[source]

Bases: _AsymmetricBase

Instructions for detailed windows, defined by 2D Polygons (lists of 2D vertices).

Note that these parameters are intended to represent windows that are specific to a particular segment and, unlike the other WindowParameters, this class performs no automatic checks to ensure that the windows lie within the boundary of the wall they have been assigned to.

Parameters:
  • polygons – An array of ladybug_geometry Polygon2D objects within the plane of the wall with one polygon for each window. The wall plane is assumed to have an origin at the first point of the wall segment and an X-axis extending along the length of the segment. The wall plane’s Y-axis always points upwards. Therefore, both X and Y values of each point in the polygon should always be positive.

  • are_doors – An array of booleans that align with the polygons and note whether each of the polygons represents a door (True) or a window (False). If None, it will be assumed that all polygons represent windows and they will be translated to Apertures in any resulting Honeybee model. (Default: None).

Properties:
  • polygons

  • are_doors

  • user_data

Usage:

Note that, if you are starting from 3D vertices of windows, you can use this class to represent them. The DetailedWindows.from_face3ds is the simplest way to do this. Otherwise, below is some sample code to convert from vertices in the same 3D space as a vertical wall to vertices in the 2D plane of the wall (as this class interprets it).

In the code, ‘seg_p1’ is the first point of a given wall segment and is assumed to be the origin of the wall plane. ‘seg_p2’ is the second point of the wall segment, and ‘vertex’ is a given vertex of the window that you want to translate from 3D coordinates into 2D. All input points are presented as arrays of 3 floats and the output is an array of 2 (x, y) coordinates.

def dot_product(v1, v2):
    return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[3]

def normalize(v):
    d = (v[0] ** 2 + v[1] ** 2 + v[2] ** 2) ** 0.5
    return (v[0] / d, v[1] / d, v[2] / d)

def xyz_to_xy(seg_p1, seg_p2, vertex):
    diff = (vertex[0] - seg_p1[0], vertex[1] - seg_p1[1], vertex[2] - seg_p1[2])
    axis = (seg_p2[0] - seg_p1[0], seg_p2[1] - seg_p1[1], seg_p2[2] - seg_p1[2])
    plane_x = normalize(axis)
    plane_y = (0, 0, 1)
    return (dot_product(plane_x , diff), dot_product(plane_y, diff))
ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – Optional tolerance value. Default: 0.01, suitable for objects in meters.

adjust_for_segment(segment, floor_to_ceiling_height, tolerance=0.01, sliver_tolerance=None)[source]

Get these parameters with vertices excluded beyond the domain of a given line.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

  • sliver_tolerance – A number to be used for the tolerance at which sliver polygons should be removed if they are created during the adjustment process. If None, the tolerance will be used. (Default: None).

Returns:

A new DetailedWindows object that fits entirely in the domain of the input line segment and floor_to_ceiling_height.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

check_self_intersecting(tolerance=0.01)[source]

Check whether any polygons in these window parameters are self intersecting.

Parameters:

tolerance – The minimum distance between a vertex coordinates where they are considered equivalent. (Default: 0.01, suitable for objects in meters).

Returns:

A string with the message. Will be an empty string if valid.

check_valid_for_segment(segment, floor_to_ceiling_height)[source]

Check that these window parameters are valid for a given LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

Returns:

A string with the message. Will be an empty string if valid.

check_window_overlaps(tolerance=0.01)[source]

Check whether any polygons overlap with one another.

Parameters:

tolerance – The minimum distance that two polygons must overlap in order for them to be considered overlapping and invalid. (Default: 0.01, suitable for objects in meters).

Returns:

A string with the message. Will be an empty string if valid.

duplicate()

Get a copy of this object.

flip(seg_length)[source]

Flip the direction of the windows along a segment.

This is needed since windows can exist asymmetrically across the wall segment and operations like reflecting the Room2D across a plane will require the window parameters to be flipped to remain in the same place.

Parameters:

seg_length – The length of the segment along which the parameters are being flipped.

classmethod from_dict(data, segment=None)[source]

Create DetailedWindows from a dictionary.

Parameters:
  • data – A dictionary in the format below. The vertices of the “polygons” can either contain 2 values (indicating they are vertices within the plane of a parent wall segment) or they can contain 3 values (indicating they are 3D world coordinates). If 3 values are used, a segment must be specified below to convert them to the 2D format.

  • segment – A LineSegment3D that sets the plane in which 3D vertices are located.

{
"type": "DetailedWindows",
"polygons": [((0.5, 0.5), (2, 0.5), (2, 2), (0.5, 2)),
             ((3, 1), (4, 1), (4, 2))],
"are_doors": [False]
}
classmethod from_face3ds(face3ds, segment, are_doors=None)[source]

Create DetailedWindows from Face3Ds and a segment they are assigned to.

Parameters:
  • face3ds – A list of Face3D objects for the detailed windows.

  • segment – A LineSegment3D that sets the plane in which 3D vertices are located.

  • are_doors – An array of booleans that align with the face3ds and note whether each of the polygons represents a door (True) or a window (False). If None, it will be assumed that all polygons represent windows and they will be translated to Apertures in any resulting Honeybee model. (Default: None).

static is_face3d_in_segment_plane(face3d, segment, height, tolerance=0.01, angle_tolerance=1)[source]

Check if a given Face3D is in the plane and range of a LineSegment3D.

Parameters:
  • face3d – A list of Face3D objects for the detailed windows.

  • segment – A LineSegment3D that sets the plane in which 3D vertices are located.

  • height – A number for the height of the wall formed by extruding the segment.

  • tolerance – The minimum difference between the coordinate values of two vertices at which they can be considered equivalent. Default: 0.01, suitable for objects in meters.

  • angle_tolerance – The max angle in degrees that the plane normals can differ from one another in order for them to be considered coplanar. Default: 1 degree.

Returns:

True if the face3d is in the plane and range of the segment. False if it is not.

is_flipped_equivalent(other, segment, tolerance=0.01)[source]

Check if this WindowParameter is equal to another when flipped.

This is useful to know if the window parameters will be valid when translated to Honeybee when they are adjacent to the other.

Parameters:
  • other – Another WindowParameter object for which flipped equivalency will be tested.

  • segment – A LineSegment3D to which these parameters are applied.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge DetailedWindows parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

merge_and_simplify(max_separation, tolerance=0.01)[source]

Merge window polygons that are close to one another into a single polygon.

This can be used to create a simpler set of windows that is easier to edit and is in the same location as the original windows.

Parameters:
  • max_separation – A number for the maximum distance between window polygons at which point they will be merged into a single geometry. Typically, this max_separation should be set to a value that is slightly larger than the window frame. Setting this equal to the tolerance will simply join neighboring windows together.

  • tolerance – The maximum difference between point values for them to be considered distinct. (Default: 0.01, suitable for objects in meters).

merge_to_bounding_rectangle(tolerance=0.01)[source]

Merge window polygons that touch or overlap with one another to a rectangle.

Parameters:

tolerance – The minimum distance from the edge of a neighboring polygon at which a point is considered to touch that polygon. (Default: 0.01, suitable for objects in meters).

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

offset(offset_distance, tolerance=0.01)[source]

Offset the edges of all polygons by a certain distance.

This is useful for translating between interfaces that expect the window frame to be included within or excluded from the geometry.

Note that this operation can often create polygons that collide with one another or extend past the parent Face. So it may be desirable to run the union_overlaps method after using this one.

Parameters:
  • offset_distance – Distance with which the edges of each polygon will be offset from the original geometry. Positive values will offset the geometry outwards and negative values will offset the geometries inwards.

  • tolerance – The minimum difference between point values for them to be considered the distinct. (Default: 0.01, suitable for objects in meters).

remove_small_windows(area_threshold)[source]

Remove any small window polygons that are below a certain area threshold.

Parameters:

area_threshold – A number for the area below which a window polygon will be removed.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

shift_vertically(shift_distance)[source]

Shift these WindowParameters up or down in the wall plane.

This is useful when the windows are assigned to a Room2D that is vertically split and new windows need to be assigned to new Room2Ds.

Parameters:

shift_distance – A number for the distance that the window parameters will be shifted. Positive values will shift the windows upwards in the wall plane and negative values will shift the windows downwards.

split(segments, tolerance=0.01)[source]

Split DetailedWindows parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get DetailedWindows as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

This will simply translate each window polygon to its own rectangular window. For merging windows that touch or overlap one another into rectangles, the merge_to_bounding_rectangle method should be used before using this method.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)[source]

Trim DetailedWindows for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

union_overlaps(tolerance=0.01)[source]

Union any window polygons that overlap with one another.

Parameters:

tolerance – The minimum distance that two polygons must overlap in order for them to be considered overlapping. (Default: 0.01, suitable for objects in meters).

property are_doors

Get an array of booleans that note whether each polygon is a door.

property polygons

Get an array of Polygon2Ds with one polygon for each window.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

class dragonfly.windowparameter.RectangularWindows(origins, widths, heights, are_doors=None)[source]

Bases: _AsymmetricBase

Instructions for several rectangular windows, defined by origin, width and height.

Note that, if these parameters are applied to a base wall that is too short or too narrow such that the windows fall outside the boundary of the wall, the generated windows will automatically be shortened or excluded. This way, a certain pattern of repeating rectangular windows can be encoded in a single RectangularWindows instance and applied to multiple Room2D segments.

Parameters:
  • origins – An array of ladybug_geometry Point2D objects within the plane of the wall for the origin of each window. The wall plane is assumed to have an origin at the first point of the wall segment and an X-axis extending along the length of the segment. The wall plane’s Y-axis always points upwards. Therefore, both X and Y values of each origin point should be positive.

  • widths – An array of positive numbers for the window widths. The length of this list must match the length of the origins.

  • heights – An array of positive numbers for the window heights. The length of this list must match the length of the origins.

  • are_doors – An array of booleans that align with the origins and note whether each of the geometries represents a door (True) or a window (False). If None, it will be assumed that all geometries represent windows and they will be translated to Apertures in any resulting Honeybee model. (Default: None).

Properties:
  • origins

  • widths

  • heights

  • are_doors

  • user_data

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – Optional tolerance value. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

check_valid_for_segment(segment, floor_to_ceiling_height)[source]

Check that these window parameters are valid for a given LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

Returns:

A string with the message. Will be an empty string if valid.

check_window_overlaps(tolerance=0.01)[source]

Check whether any windows overlap with one another.

Parameters:

tolerance – The minimum distance that two windows must overlap in order for them to be considered overlapping and invalid. (Default: 0.01, suitable for objects in meters).

Returns:

A string with the message. Will be an empty string if valid.

duplicate()

Get a copy of this object.

flip(seg_length)[source]

Flip the direction of the windows along a segment.

This is needed since windows can exist asymmetrically across the wall segment and operations like reflecting the Room2D across a plane will require the window parameters to be flipped to remain in the same place.

Parameters:

seg_length – The length of the segment along which the parameters are being flipped.

classmethod from_dict(data)[source]

Create RectangularWindows from a dictionary.

{
"type": "RectangularWindows",
"origins": [(1, 1), (3, 0.5)],  # array of (x, y) floats in wall plane
"widths": [1, 3],  # array of floats for window widths
"heights": [1, 2.5],  # array of floats for window heights
"are_doors": [False, True]  # array of booleans for whether it's a door
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge RectangularWindows parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

offset(offset_distance, tolerance=0.01)[source]

Offset the edges of all windows by a certain distance.

This is useful for translating between interfaces that expect the window frame to be included within or excluded from the geometry.

Note that this operation can often create windows that collide with one another or extend past the parent Face. So it may be desirable to convert these parameters to_detailed_windows and run the union_overlaps method after using this one.

Parameters:
  • offset_distance – Distance with which the edges of each window will be offset from the original geometry. Positive values will offset the geometry outwards and negative values will offset the geometries inwards.

  • tolerance – The minimum difference between point values for them to be considered the distinct. (Default: 0.01, suitable for objects in meters).

remove_small_windows(area_threshold)[source]

Remove any small windows that are below a certain area threshold.

Parameters:

area_threshold – A number for the area below which a window will be removed.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

shift_vertically(shift_distance)[source]

Shift these WindowParameters up or down in the wall plane.

This is useful when the windows are assigned to a Room2D that is vertically split and new windows need to be assigned to new Room2Ds.

Parameters:

shift_distance – A number for the distance that the window parameters will be shifted. Positive values will shift the windows upwards in the wall plane and negative values will shift the windows downwards.

split(segments, tolerance=0.01)[source]

Split RectangularWindows parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_detailed_windows()[source]

Get a version of these WindowParameters as DetailedWindows.

to_dict()[source]

Get RectangularWindows as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Returns the class instance. Provided here for consistency with other classes.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)[source]

Trim RectangularWindows for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property are_doors

Get an array of booleans that note whether each geometry is a door.

property heights

Get an array of numbers for the window heights.

property origins

Get an array of Point2Ds within the wall plane for the origin of each window.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property widths

Get an array of numbers for the window widths.

class dragonfly.windowparameter.RepeatingWindowRatio(window_ratio, window_height, sill_height, horizontal_separation, vertical_separation=0)[source]

Bases: SimpleWindowRatio

Instructions for repeating windows derived from an area ratio with the base face.

Parameters:
  • window_ratio – A number between 0 and 0.95 for the ratio between the window area and the total facade area.

  • window_height – A number for the target height of the windows. Note that, if the window ratio is too large for the height, the ratio will take precedence and the actual window_height will be larger than this value.

  • sill_height – A number for the target height above the bottom edge of the rectangle to start the windows. Note that, if the ratio is too large for the height, the ratio will take precedence and the sill_height will be smaller than this value.

  • horizontal_separation – A number for the target separation between individual window center lines. If this number is larger than the parent rectangle base, only one window will be produced.

  • vertical_separation – An optional number to create a single vertical separation between top and bottom windows. Default: 0.

Properties:
  • window_ratio

  • window_height

  • sill_height

  • horizontal_separation

  • vertical_separation

  • user_data

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – The maximum difference between point values for them to be considered a part of a rectangle. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create RepeatingWindowRatio from a dictionary.

{
"type": "RepeatingWindowRatio",
"window_ratio": 0.4,
"window_height": 2,
"sill_height": 0.8,
"horizontal_separation": 4,
"vertical_separation": 0.5
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge RepeatingWindowRatio parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

split(segments, tolerance=0.01)[source]

Split RepeatingWindowRatio parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get RepeatingWindowRatio as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)

Trim window parameters for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property horizontal_separation

Get a number for the separation between individual window center lines.

property rect_split

Get a boolean for whether rectangular portions are extracted.

property sill_height

Get a number for the height above the bottom edge of the floor.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property vertical_separation

Get a number for a vertical separation between top/bottom windows.

property window_height

Get a number or the target height of the windows.

property window_ratio

Get a number between 0 and 1 for the window ratio.

class dragonfly.windowparameter.RepeatingWindowWidthHeight(window_height, window_width, sill_height, horizontal_separation)[source]

Bases: _WindowParameterBase

Instructions for repeating rectangular windows of a fixed width and height.

This class effectively fills a wall with windows at the specified width, height and separation.

Parameters:
  • window_height – A number for the target height of the windows. Note that, if the window_height is larger than the height of the wall, the generated windows will have a height equal to the wall height in order to avoid having windows extend outside the wall face.

  • window_width – A number for the target width of the windows. Note that, if the window_width is larger than the width of the wall, the generated windows will have a width equal to the wall width in order to avoid having windows extend outside the wall face.

  • sill_height – A number for the target height above the bottom edge of the wall to start the windows. If the window_height is too large for the sill_height to fit within the rectangle, the window_height will take precedence.

  • horizontal_separation – A number for the target separation between individual window center lines. If this number is larger than the parent rectangle base, only one window will be produced.

Properties:
  • window_height

  • window_width

  • sill_height

  • horizontal_separation

  • user_data

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – The maximum difference between point values for them to be considered a part of a rectangle. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create RepeatingWindowWidthHeight from a dictionary.

{
"type": "RepeatingWindowWidthHeight",
"window_height": 2,
"window_width": 1.5,
"sill_height": 0.8,
"horizontal_separation": 4
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge RepeatingWindowWidthHeight parameters using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

split(segments, tolerance=0.01)[source]

Split RepeatingWindowWidthHeight parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get RepeatingWindowWidthHeight as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)

Trim window parameters for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property horizontal_separation

Get a number for the separation between individual window center lines.

property sill_height

Get a number for the height above the bottom edge of the floor.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property window_height

Get a number or the target height of the windows.

property window_width

Get a number or the target width of the windows.

class dragonfly.windowparameter.SimpleWindowArea(window_area, rect_split=True)[source]

Bases: _WindowParameterBase

Instructions for a single window defined by an absolute area.

Properties:
  • window_area

  • rect_split

  • user_data

Parameters:
  • window_area – A number for the window area in current model units. If this area is larger than the area of the Wall that it is applied to, the window will fill the parent Wall at a 99% ratio.

  • rect_split – Boolean to note whether rectangular portions of base Face should be extracted before scaling them to create apertures. For pentagonal gabled geometries, the resulting apertures will consist of one rectangle and one triangle, which can often look more realistic and is a better input for engines like EnergyPlus that cannot model windows with more than 4 vertices. However, if a single pentagonal window is desired for such a gabled shape, this input can be set to False to produce such a result.

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – Optional tolerance value. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create SimpleWindowArea from a dictionary.

{
"type": "SimpleWindowArea",
"window_area": 5.5,
"rect_split": False
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge SimpleWindowArea parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

split(segments, tolerance=0.01)[source]

Split SimpleWindowArea parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get SimpleWindowArea as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)[source]

Trim window parameters for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property rect_split

Get a boolean for whether rectangular portions are extracted.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property window_area

Get a number for the window area in current model units.

class dragonfly.windowparameter.SimpleWindowRatio(window_ratio, rect_split=True)[source]

Bases: _WindowParameterBase

Instructions for a single window defined by an area ratio with the base wall.

Properties:
  • window_ratio

  • rect_split

  • user_data

Parameters:
  • window_ratio – A number between 0 and 1 for the ratio between the window area and the parent wall surface area.

  • rect_split – Boolean to note whether rectangular portions of base Face should be extracted before scaling them to create apertures. For pentagonal gabled geometries, the resulting apertures will consist of one rectangle and one triangle, which can often look more realistic and is a better input for engines like EnergyPlus that cannot model windows with more than 4 vertices. However, if a single pentagonal window is desired for such a gabled shape, this input can be set to False to produce such a result.

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – Optional tolerance value. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create SimpleWindowRatio from a dictionary.

{
"type": "SimpleWindowRatio",
"window_ratio": 0.4,
"rect_split": False
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge SimpleWindowRatio parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

scale(factor)

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

split(segments, tolerance=0.01)[source]

Split SimpleWindowRatio parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get SimpleWindowRatio as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

trim(original_segment, sub_segment, tolerance=0.01)

Trim window parameters for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property rect_split

Get a boolean for whether rectangular portions are extracted.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property window_ratio

Get a number between 0 and 1 for the window ratio.

class dragonfly.windowparameter.SingleWindow(width, height, sill_height=1)[source]

Bases: _WindowParameterBase

Instructions for a single window in the face center defined by a width x height.

Note that, if these parameters are applied to a base face that is too short or too narrow for the input width and/or height, the generated window will automatically be shortened when it is applied to the face. In this way, setting the width to be float(‘inf’) will create parameters that always generate a ribbon window of the input height.

Parameters:
  • width – A number for the window width.

  • height – A number for the window height.

  • sill_height – A number for the window sill height. Default: 1.

Properties:
  • width

  • height

  • sill_height

  • user_data

ToString()
add_window_to_face(face, tolerance=0.01)[source]

Add Apertures to a Honeybee Face using these Window Parameters.

Parameters:
  • face – A honeybee-core Face object.

  • tolerance – Optional tolerance value. Default: 0.01, suitable for objects in meters.

area_from_segment(segment, floor_to_ceiling_height)[source]

Get the window area generated by these parameters from a LineSegment3D.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

duplicate()

Get a copy of this object.

classmethod from_dict(data)[source]

Create SingleWindow from a dictionary.

{
"type": "SingleWindow",
"width": 100,
"height": 1.5,
"sill_height": 0.8
}
static merge(window_parameters, segments, floor_to_ceiling_height)[source]

Merge SingleWindow parameters together using their assigned segments.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

static merge_to_rectangular(window_parameters, segments, floor_to_ceiling_height)

Merge any window parameters together into rectangular windows.

Parameters:
  • window_parameters – A list of WindowParameters to be merged.

  • segments – The segments to which the window parameters are assigned. These should be in order as they appear on the parent Room2D.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segment belongs.

scale(factor)[source]

Get a scaled version of these WindowParameters.

This method is called within the scale methods of the Room2D.

Parameters:

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

split(segments, tolerance=0.01)[source]

Split SingleWindow parameters across a list of ordered segments.

Parameters:
  • segments – The segments to which the window parameters are being split across. These should be in order as they appear on the parent Room2D.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

to_dict()[source]

Get SingleWindow as a dictionary.

to_rectangular_windows(segment, floor_to_ceiling_height)[source]

Get a version of these WindowParameters as RectangularWindows.

Parameters:
  • segment – A LineSegment3D to which these parameters are applied.

  • floor_to_ceiling_height – The floor-to-ceiling height of the Room2D to which the segments belong.

trim(original_segment, sub_segment, tolerance=0.01)

Trim window parameters for a sub segment given the original segment.

Parameters:
  • original_segment – The original LineSegment3D to which the window parameters are assigned.

  • sub_segment – A LineSegment3D that is a sub-segment of the original_segment, which will be used to trim the window parameters to fit this segment. Note that this sub_segment should have the same orientation as the original segment.

  • tolerance – The minimum distance between a vertex and the edge of the wall segment that is considered not touching. (Default: 0.01, suitable for objects in meters).

property height

Get a number for the window height.

property sill_height

Get a number for the sill height.

property user_data

Get or set an optional dictionary for additional meta data for this object.

This will be None until it has been set. All keys and values of this dictionary should be of a standard Python type to ensure correct serialization of the object to/from JSON (eg. str, float, int, list dict)

property width

Get a number for the window width.