diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-25 21:39:39 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-25 21:39:39 -0400 |
| commit | 6c5e256d73500be4674e8778d80b12c5b6228335 (patch) | |
| tree | 979795c683ae5dbf683cfe53c9eece4939955246 /lib/elements/satin_column.py | |
| parent | 5b5188ef9918d196173a4a543532c497140e639c (diff) | |
| parent | d14880db5820ce2175bda7bbe761c21fd6c454d0 (diff) | |
Merge remote-tracking branch 'origin/master' into lexelby-mac-build-mk2
Diffstat (limited to 'lib/elements/satin_column.py')
| -rw-r--r-- | lib/elements/satin_column.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 3593db64..2ceb38de 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -89,6 +89,17 @@ class SatinColumn(EmbroideryElement): @property @cache + def shape(self): + # This isn't used for satins at all, but other parts of the code + # may need to know the general shape of a satin column. + + flattened = self.flatten(self.parse_path()) + line_strings = [shgeo.LineString(path) for path in flattened] + + return shgeo.MultiLineString(line_strings) + + @property + @cache def csp(self): return self.parse_path() @@ -97,6 +108,8 @@ class SatinColumn(EmbroideryElement): def flattened_beziers(self): if len(self.csp) == 2: return self.simple_flatten_beziers() + elif len(self.csp) < 2: + self.fatal(_("satin column: %(id)s: at least two subpaths required (%(num)d found)") % dict(num=len(self.csp), id=self.node.get('id'))) else: return self.flatten_beziers_with_rungs() |
