This commit is contained in:
Andrej730
2024-05-23 12:02:37 +05:00
parent fffd7360cb
commit f576aadee1
23 changed files with 343 additions and 213 deletions
@@ -21,7 +21,10 @@ import math
import bmesh
import ifcopenshell.util.unit
from mathutils import Vector, Matrix
from typing import Union, Optional, Literal, Any
from typing import Union, Optional, Literal, Any, TYPE_CHECKING
if TYPE_CHECKING:
from blenderbim.bim.module.geometry.helper import Helper
Z_AXIS = Vector((0, 0, 1))
@@ -17,6 +17,7 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
from typing import Any
def map_representation(
@@ -29,7 +30,10 @@ def map_representation(
class Usecase:
def execute(self):
file: ifcopenshell.file
settings: dict[str, Any]
def execute(self) -> ifcopenshell.entity_instance:
mapping_source = self.get_mapping_source()
zero = self.file.createIfcCartesianPoint((0.0, 0.0, 0.0))
@@ -49,7 +53,7 @@ class Usecase:
}
)
def get_mapping_source(self):
def get_mapping_source(self) -> ifcopenshell.entity_instance:
for inverse in self.file.get_inverse(self.settings["representation"]):
if inverse.is_a("IfcRepresentationMap"):
return inverse
@@ -17,6 +17,7 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
@@ -351,7 +351,7 @@ def get_direct_task_outputs(task: ifcopenshell.entity_instance) -> list[ifcopens
]
def get_task_outputs(task: ifcopenshell.entity_instance, is_deep=False):
def get_task_outputs(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
if not is_deep:
return get_direct_task_outputs(task)
else:
@@ -362,7 +362,7 @@ def get_task_outputs(task: ifcopenshell.entity_instance, is_deep=False):
]
def get_task_inputs(task: ifcopenshell.entity_instance, is_deep=False):
def get_task_inputs(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
if not is_deep:
return [
object
@@ -385,7 +385,7 @@ def get_task_inputs(task: ifcopenshell.entity_instance, is_deep=False):
]
def get_task_resources(task: ifcopenshell.entity_instance, is_deep=False):
def get_task_resources(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
if not is_deep:
return [
object