From e22ae1ad6c222ba4aa4ec1ebaa7db6bed6124032 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 26 Aug 2020 15:10:36 +0300 Subject: [PATCH] - solved some deprecation warnings (Shapely module) --- CHANGELOG.md | 1 + camlib.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c4879fb..26b10eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - Drilling Tool - UI changes - Geometry object - now plotting color for an individual tool can be specified - in CutOut Tool - when using 'thin gaps' option then the cut parts are colored differently than the rest of the geometry in the Geometry object +- solved some deprecation warnings (Shapely module) 25.08.2020 diff --git a/camlib.py b/camlib.py index 79bf73ab..9fe1c3c6 100644 --- a/camlib.py +++ b/camlib.py @@ -1922,7 +1922,9 @@ class Geometry(object): # then reverse coordinates. # but prefer the first one if last == first if pt != candidate.coords[0] and pt == candidate.coords[-1]: - candidate.coords = list(candidate.coords)[::-1] + # in place coordinates update deprecated in Shapely 2.0 + # candidate.coords = list(candidate.coords)[::-1] + candidate = LineString(list(candidate.coords)[::-1]) # Straight line from current_pt to pt. # Is the toolpath inside the geometry? @@ -1933,7 +1935,9 @@ class Geometry(object): # log.debug("Walk to path #%d is inside. Joining." % path_count) # Completely inside. Append... - geo.coords = list(geo.coords) + list(candidate.coords) + # in place coordinates update deprecated in Shapely 2.0 + # geo.coords = list(geo.coords) + list(candidate.coords) + geo = LineString(list(geo.coords) + list(candidate.coords)) # try: # last = optimized_paths[-1] # last.coords = list(last.coords) + list(geo.coords)