mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
See #2820. Fix issue where some hatches weren't merged when an object had multiple SVG paths.
This commit is contained in:
@@ -529,10 +529,12 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
classes.add(el.attrib["{http://www.ifcopenshell.org/ns}guid"])
|
classes.add(el.attrib["{http://www.ifcopenshell.org/ns}guid"])
|
||||||
is_closed_polygon = False
|
is_closed_polygon = False
|
||||||
for path in el.findall("{http://www.w3.org/2000/svg}path"):
|
for path in el.findall("{http://www.w3.org/2000/svg}path"):
|
||||||
coords = [[round(float(o), 1) for o in co[1:].split(",")] for co in path.attrib["d"].split()]
|
for subpath in path.attrib["d"].split("M")[1:]:
|
||||||
if coords[0] == coords[-1]:
|
subpath = "M" + subpath.strip()
|
||||||
is_closed_polygon = True
|
coords = [[round(float(o), 1) for o in co[1:].split(",")] for co in subpath.split()]
|
||||||
polygons.append(shapely.Polygon(coords))
|
if coords[0] == coords[-1]:
|
||||||
|
is_closed_polygon = True
|
||||||
|
polygons.append(shapely.Polygon(coords))
|
||||||
if is_closed_polygon:
|
if is_closed_polygon:
|
||||||
el.getparent().remove(el)
|
el.getparent().remove(el)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user