def add_window_to_face(self, face, tolerance=0.01): """Add Apertures to a Honeybee Face using these Window Parameters. Args: face: A honeybee-core Face object. tolerance: Optional tolerance value. Default: 0.01, suitable for objects in meters. """ scale_factor = self.window_ratio**.5 ap_face = face.geometry.scale(scale_factor, face.geometry.center) aperture = Aperture('{}_Glz1'.format(face.identifier), ap_face) aperture._parent = face face.add_aperture(aperture) # if the Aperture is interior, set adjacent boundary condition if isinstance(face._boundary_condition, Surface): ids = face._boundary_condition.boundary_condition_objects adj_ap_id = '{}_Glz1'.format(ids[0]) final_ids = (adj_ap_id, ) + ids aperture.boundary_condition = Surface(final_ids, True)
def add_window_to_face(self, face, tolerance=0.01): """Add Apertures to a Honeybee Face using these Window Parameters. Args: face: A honeybee-core Face object. tolerance: Optional tolerance value. Default: 0.01, suitable for objects in meters. """ # collect the global properties of the face that set limits on apertures wall_plane = face.geometry.plane width_seg = LineSegment3D.from_end_points(face.geometry[0], face.geometry[1]) height_seg = LineSegment3D.from_end_points(face.geometry[1], face.geometry[2]) max_width = width_seg.length * 0.99 max_height = height_seg.length * 0.99 # loop through each window and create its geometry for i, (o, wid, hgt) in enumerate(zip(self.origins, self.widths, self.heights)): final_width = max_width - o.x if wid + o.x > max_width else wid final_height = max_height - o.y if hgt + o.y > max_height else hgt if final_height > 0 and final_height > 0: # inside wall boundary base_plane = Plane(wall_plane.n, wall_plane.xy_to_xyz(o), wall_plane.x) ap_face = Face3D.from_rectangle(final_width, final_height, base_plane) aperture = Aperture('{}_Glz{}'.format(face.identifier, i + 1), ap_face) aperture._parent = face face.add_aperture(aperture) # if the Aperture is interior, set adjacent boundary condition if isinstance(face._boundary_condition, Surface): ids = face._boundary_condition.boundary_condition_objects adj_ap_id = '{}_Glz{}'.format(ids[0], i + 1) final_ids = (adj_ap_id, ) + ids aperture.boundary_condition = Surface(final_ids, True)
def add_window_to_face(self, face, tolerance=0.01): """Add Apertures to a Honeybee Face using these Window Parameters. Args: face: A honeybee-core Face object. tolerance: Optional tolerance value. Default: 0.01, suitable for objects in meters. """ wall_plane = face.geometry.plane # loop through each window and create its geometry for i, polygon in enumerate(self.polygons): pt3d = tuple(wall_plane.xy_to_xyz(pt) for pt in polygon) aperture = Aperture('{}_Glz{}'.format(face.identifier, i + 1), Face3D(pt3d)) aperture._parent = face face.add_aperture(aperture) # if the Aperture is interior, set adjacent boundary condition if isinstance(face._boundary_condition, Surface): ids = face._boundary_condition.boundary_condition_objects adj_ap_id = '{}_Glz{}'.format(ids[0], i + 1) final_ids = (adj_ap_id, ) + ids aperture.boundary_condition = Surface(final_ids, True)