Don't try to add closed loops to other paths

This is too slow for hole patterns and the holes can't be added anywhere
anyway.
This commit is contained in:
Florian Festi 2022-06-07 08:49:33 +02:00
parent 4344c93b6e
commit bfa327d83a
1 changed files with 9 additions and 9 deletions

View File

@ -118,15 +118,15 @@ class Part:
return
# search for path ending at new start coordinates to append this path to
xy0 = self.path[0][1:3]
for p in reversed(self.pathes):
if self.path[0][0] == "T":
break
xy1 = p.path[-1][1:3]
if points_equal(*xy0, *xy1):
# todo: check for same color and linewidth
p.path.extend(self.path[1:])
self.path = []
return p
if (not points_equal(*xy0, *self.path[-1][1:3]) and
not self.path[0][0] == "T"):
for p in reversed(self.pathes):
xy1 = p.path[-1][1:3]
if points_equal(*xy0, *xy1):
# todo: check for same color and linewidth
p.path.extend(self.path[1:])
self.path = []
return p
p = Path(self.path, params)
self.pathes.append(p)
self.path = []