diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-01-28 22:33:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-28 22:33:58 +0100 |
| commit | f2f1fea0cb5d5fe122cc62a338b3b6513528f313 (patch) | |
| tree | a2cd2f894826a1108af2d49cb124fc9dfe3b056e /lib | |
| parent | c730250f9f8ee16bfef4114b9c7394660d53cafc (diff) | |
remove subpaths with only one node from satins (#2033)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/elements/satin_column.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 0981e6c3..1841bba1 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -361,7 +361,10 @@ class SatinColumn(EmbroideryElement): @property @cache def csp(self): - return self.parse_path() + paths = self.parse_path() + # exclude subpaths which are just a point + paths = [path for path in paths if len(path) >= 2] + return paths @property @cache @@ -518,8 +521,9 @@ class SatinColumn(EmbroideryElement): def validation_errors(self): # The node should have exactly two paths with the same number of points - or it should # have two rails and at least one rung - - if len(self.rails) < 2: + if len(self.csp) < 2: + yield TooFewPathsError((0, 0)) + elif len(self.rails) < 2: yield TooFewPathsError(self.shape.centroid) elif len(self.csp) == 2: if len(self.rails[0]) != len(self.rails[1]): |
