Temporary hack for path tags without 'd' attr #6871 #6876

This commit is contained in:
Andrej730
2025-07-11 18:23:31 +05:00
parent baeaa073df
commit 6d8e513f97
2 changed files with 8 additions and 0 deletions
@@ -1470,6 +1470,9 @@ class CreateDrawing(bpy.types.Operator):
classes.add(el.attrib["{http://www.ifcopenshell.org/ns}guid"])
is_closed_polygon = False
for path in el.findall("{http://www.w3.org/2000/svg}path"):
# Temporary hack.
if "d" not in path.attrib:
continue
for subpath in path.attrib["d"].split("M")[1:]:
subpath_co = "M" + subpath.strip(" Z")
# Round due to inaccuracies from Blender meshes and bisection
+5
View File
@@ -2492,6 +2492,11 @@ class Drawing(bonsai.core.tool.Drawing):
paths = element_g.findall(f"{SVG}path")
for path in paths:
# For some reason `<path/>` without "d" attribute can occur too. See #6871.
# It's unclear whether this issue is still present with the updated ifcopenshell core,
# but adding this fix for now. Could be reveted later.
if "d" not in path.attrib:
continue
path = path.attrib["d"]
if not re.match(MULTI_POLYLINE_PATTERN, path):