diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-09-15 21:33:44 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-09-15 21:35:04 -0400 |
| commit | 9b619de22807b144373a6166621a7c3002929b2b (patch) | |
| tree | cd8a52bb90b1437b2d5899120e84c1931a3343a0 /lib/stitch_plan/stitch.py | |
| parent | bdf98a7e91b2282e52d6a4e8e3c7344dceb24491 (diff) | |
use faster algorithm for ties
Diffstat (limited to 'lib/stitch_plan/stitch.py')
| -rw-r--r-- | lib/stitch_plan/stitch.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/stitch_plan/stitch.py b/lib/stitch_plan/stitch.py index 5fe10fb8..0609dd10 100644 --- a/lib/stitch_plan/stitch.py +++ b/lib/stitch_plan/stitch.py @@ -2,7 +2,7 @@ from ..utils.geometry import Point class Stitch(Point): - def __init__(self, x, y, color=None, jump=False, stop=False, trim=False, color_change=False, fake_color_change=False, no_ties=False): + def __init__(self, x, y=None, color=None, jump=False, stop=False, trim=False, color_change=False, fake_color_change=False, no_ties=False): self.x = x self.y = y self.color = color @@ -13,6 +13,12 @@ class Stitch(Point): self.fake_color_change = fake_color_change self.no_ties = no_ties + # Allow creating a Stitch from a Point + if isinstance(x, Point): + point = x + self.x = point.x + self.y = point.y + def __repr__(self): return "Stitch(%s, %s, %s, %s, %s, %s, %s, %s%s)" % (self.x, self.y, |
