summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/stitch.py
diff options
context:
space:
mode:
authorGeorge Steel <george.steel@gmail.com>2023-01-08 18:33:02 -0500
committerGitHub <noreply@github.com>2023-01-08 18:33:02 -0500
commitfbf57b92d2f37814e0029a1e5b8b413f76697463 (patch)
treea5c302b6e093edbca4c20b18ebd9b14dea29da11 /lib/stitch_plan/stitch.py
parenta7b2122d91703d72177cf980cecbef8fca3d54ec (diff)
parent8d13e09bc41f9cfeaa0cd32cd75fa4da07afc03c (diff)
Merge pull request #1918 from inkstitch/george-steel/random-base-satin
Add randomization options to satin columns and rewrite split stitches
Diffstat (limited to 'lib/stitch_plan/stitch.py')
-rw-r--r--lib/stitch_plan/stitch.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/stitch_plan/stitch.py b/lib/stitch_plan/stitch.py
index 0d46b85d..3bfa7075 100644
--- a/lib/stitch_plan/stitch.py
+++ b/lib/stitch_plan/stitch.py
@@ -4,6 +4,7 @@
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
from ..utils.geometry import Point
+from shapely import geometry as shgeo
class Stitch(Point):
@@ -17,13 +18,13 @@ class Stitch(Point):
# Allow creating a Stitch from another Stitch. Attributes passed as
# arguments will override any existing attributes.
base_stitch = x
- self.x = base_stitch.x
- self.y = base_stitch.y
- elif isinstance(x, Point):
+ self.x: float = base_stitch.x
+ self.y: float = base_stitch.y
+ elif isinstance(x, (Point, shgeo.Point)):
# Allow creating a Stitch from a Point
point = x
- self.x = point.x
- self.y = point.y
+ self.x: float = point.x
+ self.y: float = point.y
else:
Point.__init__(self, x, y)