Fix #3531. See #3660. Exclude 2D elements from generating shapely surface polygons in drawings.

This commit is contained in:
Dion Moult
2023-08-31 18:13:53 +10:00
parent 9cc1f5f0e3
commit b6f2fdef77
@@ -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()]