mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 06:18:09 +00:00
typing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user