Fix error adding a space boundary (a7509db)

This commit is contained in:
Andrej730
2025-03-31 18:18:06 +05:00
parent e6be79f2ad
commit 6adf5d957a
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -1092,7 +1092,10 @@ class IfcImporter:
verts=verts,
load_indexed_maps=self.ifc_import_settings.load_indexed_maps,
)
return tool.Loader.slice_layerset_mesh(element, mesh)
# E.g. `create_mesh` is also used for IfcRelSpaceBoundary.
if element.is_a("IfcObjectDefinition"):
return tool.Loader.slice_layerset_mesh(element, mesh)
return mesh
except:
self.ifc_import_settings.logger.error("Could not create mesh for %s", element)
import traceback
@@ -72,13 +72,16 @@ class Loader:
# ConnectionGeometry is optional in IFC schema for some reasons.
if not boundary.ConnectionGeometry:
return None
assert self.ifc_importer
assert self.operator
surface = boundary.ConnectionGeometry.SurfaceOnRelatingElement
# Workaround for invalid geometry provided by Revit. See https://github.com/Autodesk/revit-ifc/issues/270
if surface.is_a("IfcCurveBoundedPlane") and not getattr(surface, "InnerBoundaries", None):
surface.InnerBoundaries = ()
try:
shape = ifcopenshell.geom.create_shape(self.settings, surface)
mesh = self.ifc_importer.create_mesh(None, shape)
mesh = self.ifc_importer.create_mesh(boundary, shape)
assert mesh
tool.Loader.link_mesh(shape, mesh)
except RuntimeError:
# Fallback solution for invalid geometry provided by Revit. (InnerBoundaries cuting OuterBoundary)