This commit is contained in:
Andrej730
2024-06-10 14:53:14 +05:00
parent 6552463ed9
commit 51f859d8e4
5 changed files with 49 additions and 35 deletions
+2 -2
View File
@@ -896,7 +896,7 @@ class IfcImporter:
def create_generic_shape(
self, element: ifcopenshell.entity_instance
) -> Union[ifcopenshell_wrapper.TriangulationElement, None]:
) -> Union[ifcopenshell.geom.ShapeElementType, None]:
for settings in self.context_settings:
try:
result = ifcopenshell.geom.create_shape(settings, element)
@@ -1730,7 +1730,7 @@ class IfcImporter:
) -> bpy.types.Mesh:
try:
if hasattr(shape, "geometry"):
# shape is ifcopenshell_wrapper.TriangulationElement
# shape is ShapeElementType
geometry = shape.geometry
else:
geometry = shape
@@ -26,6 +26,7 @@ import platform
import subprocess
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.geom
import ifcopenshell.util.element
import ifcopenshell.util.placement
import ifcopenshell.util.representation
@@ -47,6 +47,7 @@ from math import radians
from pathlib import Path
from mathutils import Vector, Matrix
from bpy.app.handlers import persistent
from ifcopenshell.geom import ShapeElementType, ShapeType
from blenderbim.bim.module.project.data import LinksData
from blenderbim.bim.module.project.decorator import ProjectDecorator, ClippingPlaneDecorator
from typing import Union
@@ -1453,7 +1454,7 @@ class LoadLinkedProject(bpy.types.Operator):
break
return {"FINISHED"}
def is_local(self, shape):
def is_local(self, shape: ShapeElementType) -> bool:
m = shape.transformation.matrix
if max([abs(co) for co in (m[9], m[10], m[11])]) > 1000:
return False
@@ -1461,7 +1462,7 @@ class LoadLinkedProject(bpy.types.Operator):
return False
return True
def process_occurrence(self, shape):
def process_occurrence(self, shape: ShapeElementType) -> None:
element = self.file.by_id(shape.id)
matrix = shape.transformation.matrix
faces = shape.geometry.faces