From b6f2fdef776f3ceae026fe37016d9749a83e29b1 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 31 Aug 2023 18:13:53 +1000 Subject: [PATCH] Fix #3531. See #3660. Exclude 2D elements from generating shapely surface polygons in drawings. --- src/blenderbim/blenderbim/bim/module/drawing/operator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/operator.py b/src/blenderbim/blenderbim/bim/module/drawing/operator.py index 389d5958fa..a158fb0235 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/operator.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/operator.py @@ -566,10 +566,19 @@ class CreateDrawing(bpy.types.Operator): m44[1][3] = m3[1][2] m44 = np.linalg.inv(m44) + elements_with_faces = set() + for element in drawing_elements.copy(): + obj = tool.Ifc.get_object(element) + if obj and obj.type == "MESH" and len(obj.data.polygons): + elements_with_faces.add(element.GlobalId) + projections = root.xpath(".//svg:g[contains(@class, 'projection')]", namespaces={'svg': 'http://www.w3.org/2000/svg'}) boundary_lines = [] for projection in projections: + global_id = projection.attrib['{http://www.ifcopenshell.org/ns}guid'] + if global_id not in elements_with_faces: + continue for path in projection.findall("./{http://www.w3.org/2000/svg}path"): # Rounding is necessary to ensure coincident points are coincident start, end = [[round(float(o), 1) for o in co[1:].split(",")] for co in path.attrib["d"].split()]