This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shade): add an object to capture shade elements
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Honeybee-IFC Shade object.""" | ||
|
||
|
||
import ifcopenshell | ||
from ifcopenshell.entity_instance import entity_instance as IfcElement | ||
from honeybee.shade import Shade as HBShade | ||
from honeybee.typing import clean_and_id_string | ||
from .element import Element | ||
|
||
|
||
class Shade(Element): | ||
"""Honeybee-IFC Opening object. | ||
Args: | ||
shade: Any Ifc object that needs to be converted to shade. | ||
settings: An ifcopenshell.geom.settings object. | ||
""" | ||
|
||
def __init__(self, shade: IfcElement, settings: ifcopenshell.geom.settings = None): | ||
super().__init__(shade, settings) | ||
self.shade = shade | ||
self.settings = settings or self._settings() | ||
|
||
def to_honeybee(self): | ||
"""Convert IFC object to Honeybee shade.""" | ||
return [HBShade(clean_and_id_string('Shade'), face) | ||
for face in self.polyface3d.faces] |