summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2022-05-02 14:47:43 -0400
committerKaalleen <reni@allenka.de>2022-05-04 19:18:33 +0200
commit60fb7d0a9efa43d3b58867927ecede6cfdc5ab21 (patch)
tree80db4bc7734d77c4d41be771f77f0430224469dc /lib
parent8a1f70a6cdcbf7c599d9f00837996a0f6734f780 (diff)
fix more shapely deprecations
Diffstat (limited to 'lib')
-rw-r--r--lib/elements/fill_stitch.py2
-rw-r--r--lib/stitches/tangential_fill_stitch_line_creator.py8
-rw-r--r--lib/stitches/tangential_fill_stitch_pattern_creator.py4
3 files changed, 6 insertions, 8 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index 3b87ea0c..4157d3fb 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -562,7 +562,7 @@ class FillStitch(EmbroideryElement):
def do_tangential_fill(self, last_patch, starting_point):
stitch_groups = []
- polygons = list(self.fill_shape)
+ polygons = self.fill_shape.geoms
if not starting_point:
starting_point = (0, 0)
for poly in polygons:
diff --git a/lib/stitches/tangential_fill_stitch_line_creator.py b/lib/stitches/tangential_fill_stitch_line_creator.py
index 042bdde0..7f8b3bea 100644
--- a/lib/stitches/tangential_fill_stitch_line_creator.py
+++ b/lib/stitches/tangential_fill_stitch_line_creator.py
@@ -29,7 +29,7 @@ def offset_linear_ring(ring, offset, resolution, join_style, mitre_limit):
return result.exterior
else:
result_list = []
- for poly in result:
+ for poly in result.geoms:
result_list.append(poly.exterior)
return MultiLineString(result_list)
@@ -41,10 +41,8 @@ def take_only_valid_linear_rings(rings):
"""
if rings.geom_type == "MultiLineString":
new_list = []
- for ring in rings:
- if len(ring.coords) > 3 or (
- len(ring.coords) == 3 and ring.coords[0] != ring.coords[-1]
- ):
+ for ring in rings.geoms:
+ if len(ring.coords) > 3 or (len(ring.coords) == 3 and ring.coords[0] != ring.coords[-1]):
new_list.append(ring)
if len(new_list) == 1:
return LinearRing(new_list[0])
diff --git a/lib/stitches/tangential_fill_stitch_pattern_creator.py b/lib/stitches/tangential_fill_stitch_pattern_creator.py
index 0ee1c031..20f7a651 100644
--- a/lib/stitches/tangential_fill_stitch_pattern_creator.py
+++ b/lib/stitches/tangential_fill_stitch_pattern_creator.py
@@ -250,8 +250,8 @@ def interpolate_linear_rings(ring1, ring2, max_stitch_length, start=None):
# orders of magnitude faster because we're not building and querying a KDTree.
num_points = int(20 * ring1.length / max_stitch_length)
- ring1_resampled = trimesh.path.traversal.resample_path(ring1, count=num_points)
- ring2_resampled = trimesh.path.traversal.resample_path(ring2, count=num_points)
+ ring1_resampled = trimesh.path.traversal.resample_path(np.array(ring1.coords), count=num_points)
+ ring2_resampled = trimesh.path.traversal.resample_path(np.array(ring2.coords), count=num_points)
if start is not None:
ring1_resampled = reorder_linear_ring(ring1_resampled, start)