This commit is contained in:
Andrej
2025-06-04 19:49:35 +05:00
parent 5af7c9a32d
commit 87265d052b
14 changed files with 212 additions and 90 deletions
@@ -27,9 +27,7 @@ def get_constraints(product: ifcopenshell.entity_instance) -> list[ifcopenshell.
Retrieves the constraints assigned to the `product`.
:param product: The IFC element.
:type product: ifcopenshell.entity_instance
:return: List of assigned constraints.
:rtype: list[ifcopenshell.entity_instance]
"""
constraints = []
for rel in product.HasAssociations or []:
@@ -43,9 +41,7 @@ def get_constrained_elements(constraint: ifcopenshell.entity_instance) -> set[if
Retrieves the elements constrained by a `constraint`.
:param product: The IFC element.
:type product: ifcopenshell.entity_instance
:return: Set of elements constrained by a `constrant`.
:rtype: set[ifcopenshell.entity_instance]
"""
elements = set()
for rel in constraint.file.get_inverse(constraint):
@@ -59,9 +55,7 @@ def get_metrics(constraint: ifcopenshell.entity_instance) -> list[ifcopenshell.e
Retrieves the list of nested constraints for a IfcObjective `constraint`.
:param product: IfcObjective constraint.
:type product: ifcopenshell.entity_instance
:return: List of nested constraints.
:rtype: list[ifcopenshell.entity_instance]
"""
metrics = []