From 14cea7453b06b9f4867d0f5ea3ef0379639974ca Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 27 Sep 2024 14:09:45 +0500 Subject: [PATCH] Skip failed to load IfcSweptDiskSolid shapes Noticed in the file attached in #5474 (note that it's not the issue that's causing the segfault), it was failing due IFCSWEPTDISKSOLID's IFCINDEXEDPOLYCURVE having just 1 point, resulting in something like '[Error] [ 14:07:00] No segment successfully converted: 80=IfcIndexedPolyCurve(79,$)'. Not sure if this kind of polyline is considered valid in IFC but it doesn't trigger any validation errors, so I guess it shouldn't stop IFC project from loading in BBIM. --- src/bonsai/bonsai/bim/import_ifc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/bim/import_ifc.py b/src/bonsai/bonsai/bim/import_ifc.py index 8681615fd3..12b399f798 100644 --- a/src/bonsai/bonsai/bim/import_ifc.py +++ b/src/bonsai/bonsai/bim/import_ifc.py @@ -1112,6 +1112,8 @@ class IfcImporter: matrix[2][3] *= self.unit_scale # TODO: support inner radius, start param, and end param geometry = tool.Loader.create_generic_shape(item.Directrix) + if not geometry: + continue e = geometry.edges v = geometry.verts vertices = [list(matrix @ [v[i], v[i + 1], v[i + 2], 1]) for i in range(0, len(v), 3)]