Fix errors loading bounding box representations #4832

This commit is contained in:
Andrej730
2024-07-03 15:57:01 +05:00
parent 5a0df870f5
commit 33785620d5
5 changed files with 6 additions and 0 deletions
@@ -171,6 +171,7 @@ class CreateAllShapes(bpy.types.Operator):
total = len(elements)
settings = ifcopenshell.geom.settings()
settings.set("keep-bounding-boxes", True)
settings_2d = ifcopenshell.geom.settings()
settings_2d.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
failures = []
@@ -224,6 +225,7 @@ class CreateShapeFromStepId(bpy.types.Operator):
self.file = IfcStore.get_file()
element = self.file.by_id(self.step_id or int(context.scene.BIMDebugProperties.step_id))
settings = ifcopenshell.geom.settings()
settings.set("keep-bounding-boxes", True)
if self.should_include_curves:
settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
shape = ifcopenshell.geom.create_shape(settings, element)
@@ -1168,6 +1168,7 @@ def create_mesh_from_shape(
) -> bpy.types.Mesh:
if settings is None:
settings = ifcopenshell.geom.settings()
settings.set("keep-bounding-boxes", True)
shape = ifcopenshell.geom.create_shape(settings, element)
geometry = shape.geometry if element.is_a("IfcRoot") else shape
faces = geometry.faces
@@ -552,6 +552,7 @@ class Geometry(blenderbim.core.tool.Geometry):
settings = ifcopenshell.geom.settings()
settings.set("weld-vertices", True)
settings.set("apply-default-materials", False)
settings.set("keep-bounding-boxes", True)
context = representation.ContextOfItems
if element.is_a("IfcTypeProduct"):
+1
View File
@@ -556,6 +556,7 @@ class Loader(blenderbim.core.tool.Loader):
settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
settings.set("context-ids", [context.id()])
settings.set("apply-default-materials", False)
settings.set("keep-bounding-boxes", True)
if is_gross:
settings.set("disable-opening-subtractions", True)
results.append(settings)
@@ -16,6 +16,7 @@ class BlenderImporter:
self.created_guids = set()
self.settings = ifcopenshell.geom.settings()
self.settings.set("keep-bounding-boxes", True)
self.settings.set("mesher-linear-deflection", self.deflection_tolerance)
self.settings.set("mesher-angular-deflection", self.angular_tolerance)
self.settings_2d = ifcopenshell.geom.settings()