From 1ecf722111b301833b0efea67c714ddd4aae66a9 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 1 Dec 2024 19:04:59 +0100 Subject: [PATCH] Assert single polygon in arrange-spaces and no need for the closing point --- src/ifcopenshell-python/ifcopenshell/draw.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/draw.py b/src/ifcopenshell-python/ifcopenshell/draw.py index efecf33993..ca88e1d86a 100644 --- a/src/ifcopenshell-python/ifcopenshell/draw.py +++ b/src/ifcopenshell-python/ifcopenshell/draw.py @@ -435,7 +435,8 @@ def main( # polies = W.svg_to_polygons(svg_contents, "IfcSpace") polies = [p.getAttribute('d') for p in yield_groups(svg1, "path") if 'IfcSpace' in p.parentNode.getAttribute('class')] - polies = [[[*map(float, s[1:].split(','))] for s in d.split(' ')] for d in polies] + assert(all(s.count('M') == 1 for s in polies)) + polies = [[[*map(float, s[1:].split(','))] for s in d.split(' ')[:-1]] for d in polies] def create_poly(b): p = ifcopenshell.ifcopenshell_wrapper.polygon_2() p.boundary = b