mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 05:10:53 +00:00
Fix #3479. Regression in 69fa124 when addressing #3421 that led to objects with multiple paths not taking part in the wall / slab joining procedure.
This commit is contained in:
@@ -919,7 +919,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
path.getparent().remove(path)
|
path.getparent().remove(path)
|
||||||
for result in results:
|
for result in results:
|
||||||
for geom in result.geoms:
|
for geom in result.geoms:
|
||||||
path = etree.SubElement(el, "path")
|
path = etree.SubElement(el, "{http://www.w3.org/2000/svg}path")
|
||||||
if isinstance(geom, shapely.Polygon):
|
if isinstance(geom, shapely.Polygon):
|
||||||
d = (
|
d = (
|
||||||
"M"
|
"M"
|
||||||
@@ -963,8 +963,10 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
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"):
|
||||||
for subpath in path.attrib["d"].split("M")[1:]:
|
for subpath in path.attrib["d"].split("M")[1:]:
|
||||||
subpath = "M" + subpath.strip()
|
subpath_co = "M" + subpath.strip(" Z")
|
||||||
coords = [[round(float(o), 1) for o in co[1:].split(",")] for co in subpath.split()]
|
coords = [[round(float(o), 1) for o in co[1:].split(",")] for co in subpath_co.split()]
|
||||||
|
if subpath.strip().lower().endswith("z"):
|
||||||
|
coords.append(coords[0])
|
||||||
if len(coords) > 2 and coords[0] == coords[-1]:
|
if len(coords) > 2 and coords[0] == coords[-1]:
|
||||||
is_closed_polygon = True
|
is_closed_polygon = True
|
||||||
polygons.append(shapely.Polygon(coords))
|
polygons.append(shapely.Polygon(coords))
|
||||||
|
|||||||
Reference in New Issue
Block a user