diff options
| author | Lex Neva <github@lexneva.name> | 2017-09-27 00:59:32 +0100 |
|---|---|---|
| committer | Lex Neva <github@lexneva.name> | 2017-09-27 00:59:32 +0100 |
| commit | 4b7810263284a4dd0c1975735b837f7640443f3d (patch) | |
| tree | 2f844ccebf97671dd7af4325cca3c2ff99935f33 /embroider.py | |
| parent | 41effdbf9f13c7d56cdf1acb027e4271d673ee51 (diff) | |
bugfix and useful warning
Diffstat (limited to 'embroider.py')
| -rw-r--r-- | embroider.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/embroider.py b/embroider.py index 5e0899b7..b6e0ab51 100644 --- a/embroider.py +++ b/embroider.py @@ -1245,11 +1245,15 @@ class SatinColumn(EmbroideryElement): result = [] for rail in rails: + if not rail.is_simple: + self.fatal("One or more rails crosses itself, and this is not allowed. Please split into multiple satin columns.") + # handle null intersections here? linestrings = shapely.ops.split(rail, rungs) - if len(linestrings.geoms) < len(rungs) + 1: - raise Exception("Expected %d linestrings, got %d" % (len(rungs) + 1, len(linestrings.geoms))) + if len(linestrings.geoms) < len(rungs.geoms) + 1: + print >> dbg, [str(rail) for rail in rails], [str(rung) for rung in rungs] + self.fatal("Expected %d linestrings, got %d" % (len(rungs.geoms) + 1, len(linestrings.geoms))) paths = [[PyEmb.Point(*coord) for coord in ls.coords] for ls in linestrings.geoms] result.append(paths) |
