diff --git a/CHANGELOG.md b/CHANGELOG.md index af6f32e5..c068ed0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM Evo beta ================================================= +15.04.2023 + +- changed the shapely imports a bit according to the specifications of Shapely 2.0 +- changed the requirements.txt file to reflect the need for at least Shapely in version 2.0 + 08.04.2023 - fixed some really long strings in the Geometry Editor toolbar actions diff --git a/Utils/vispy_example_qt6_draw.py b/Utils/vispy_example_qt6_draw.py index a20d4428..47b9612d 100644 --- a/Utils/vispy_example_qt6_draw.py +++ b/Utils/vispy_example_qt6_draw.py @@ -14,7 +14,7 @@ from vispy.visuals import CompoundVisual, MeshVisual, LineVisual from vispy.scene.visuals import VisualNode, generate_docstring, visuals from vispy.gloo import set_state -from shapely.geometry import Polygon, LineString, LinearRing +from shapely import Polygon, LineString, LinearRing import sys diff --git a/appCommon/Common.py b/appCommon/Common.py index 54c1265f..ed51aff7 100644 --- a/appCommon/Common.py +++ b/appCommon/Common.py @@ -12,7 +12,7 @@ # ########################################################## from PyQt6 import QtCore -from shapely.geometry import Polygon, Point, LineString +from shapely import Polygon, Point, LineString from shapely.ops import unary_union from appGUI.VisPyVisuals import ShapeCollection diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index 2e48deff..3c563507 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -19,7 +19,7 @@ from appEditors.exc_plugins.ExcCopyPlugin import ExcCopyEditorTool from appGUI.GUIElements import FCEntry, FCTable, FCDoubleSpinner, FCButton, FCLabel, GLay from appEditors.AppGeoEditor import FCShapeTool, DrawTool, DrawToolShape, DrawToolUtilityShape, AppGeoEditor -from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point +from shapely import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point from shapely.geometry.base import BaseGeometry from shapely.affinity import scale, rotate, translate # from appCommon.Common import LoudDict diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index dcd15f4c..71831c2e 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -33,7 +33,7 @@ from appEditors.geo_plugins.GeoCopyPlugin import CopyEditorTool from vispy.geometry import Rect -from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point, box, base +from shapely import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point, box, base from shapely.ops import unary_union, linemerge from shapely.affinity import translate, scale, skew, rotate from shapely.geometry.polygon import orient diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index c230232a..caafd10a 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -32,7 +32,7 @@ from numpy.linalg import norm as numpy_norm import math from copy import deepcopy -from shapely.geometry import Point, Polygon, MultiPolygon, LineString, LinearRing, box +from shapely import Point, Polygon, MultiPolygon, LineString, LinearRing, box from shapely.ops import unary_union from shapely.affinity import translate, scale, skew, rotate diff --git a/appEditors/geo_plugins/GeoBufferPlugin.py b/appEditors/geo_plugins/GeoBufferPlugin.py index caa2bc8b..6640787c 100644 --- a/appEditors/geo_plugins/GeoBufferPlugin.py +++ b/appEditors/geo_plugins/GeoBufferPlugin.py @@ -3,7 +3,7 @@ from PyQt6 import QtWidgets from appTool import AppToolEditor from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCDoubleSpinner, FCComboBox -from shapely.geometry import Polygon +from shapely import Polygon import gettext import appTranslation as fcTranslate diff --git a/appEditors/geo_plugins/GeoCirclePlugin.py b/appEditors/geo_plugins/GeoCirclePlugin.py index f162147c..342d3f40 100644 --- a/appEditors/geo_plugins/GeoCirclePlugin.py +++ b/appEditors/geo_plugins/GeoCirclePlugin.py @@ -3,7 +3,7 @@ from PyQt6 import QtWidgets, QtGui from appTool import AppToolEditor from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCDoubleSpinner -from shapely.geometry import Point +from shapely import Point from shapely.affinity import scale, rotate import gettext diff --git a/appEditors/geo_plugins/GeoPaintPlugin.py b/appEditors/geo_plugins/GeoPaintPlugin.py index 9c1fd6d7..b12e2e84 100644 --- a/appEditors/geo_plugins/GeoPaintPlugin.py +++ b/appEditors/geo_plugins/GeoPaintPlugin.py @@ -5,7 +5,7 @@ from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCFrame, FCButton, G FCCheckBox from camlib import Geometry -from shapely.geometry import Polygon +from shapely import Polygon from shapely.ops import unary_union import gettext diff --git a/appEditors/geo_plugins/GeoRectanglePlugin.py b/appEditors/geo_plugins/GeoRectanglePlugin.py index 87bbba08..42ae2590 100644 --- a/appEditors/geo_plugins/GeoRectanglePlugin.py +++ b/appEditors/geo_plugins/GeoRectanglePlugin.py @@ -4,7 +4,8 @@ from appTool import AppToolEditor from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, GLay, FCFrame, FCDoubleSpinner, RadioSetCross, \ RadioSet, NumericalEvalEntry -from shapely.geometry import box, base +from shapely import box +from shapely.geometry import base import gettext import appTranslation as fcTranslate diff --git a/appEditors/grb_plugins/GrbCommon.py b/appEditors/grb_plugins/GrbCommon.py index 9b433ba3..78724841 100644 --- a/appEditors/grb_plugins/GrbCommon.py +++ b/appEditors/grb_plugins/GrbCommon.py @@ -4,7 +4,7 @@ # ########################################################################################### from PyQt6.QtCore import Qt -from shapely.geometry import MultiLineString, Polygon +from shapely import MultiLineString, Polygon import numpy as np diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py index 10fd338c..bb052cff 100644 --- a/appGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -14,7 +14,7 @@ from PyQt6.QtCore import pyqtSignal # Used for solid polygons in Matplotlib from descartes.patch import PolygonPatch -from shapely.geometry import Polygon, LineString, LinearRing +from shapely import Polygon, LineString, LinearRing from copy import deepcopy diff --git a/appGUI/VisPyVisuals.py b/appGUI/VisPyVisuals.py index 08818141..b2098f78 100644 --- a/appGUI/VisPyVisuals.py +++ b/appGUI/VisPyVisuals.py @@ -10,7 +10,7 @@ from vispy.visuals import CompoundVisual, LineVisual, MeshVisual, TextVisual, Ma from vispy.scene.visuals import VisualNode, generate_docstring, visuals from vispy.gloo import set_state from vispy.color import Color -from shapely.geometry import Polygon, LineString, LinearRing +from shapely import Polygon, LineString, LinearRing import threading import numpy as np from appGUI.VisPyTesselators import GLUTess diff --git a/appMain.py b/appMain.py index 604f456d..dc7e780c 100644 --- a/appMain.py +++ b/appMain.py @@ -35,7 +35,7 @@ import platform import re import subprocess -from shapely.geometry import Point, MultiPolygon, MultiLineString, Polygon, LinearRing, LineString +from shapely import Point, MultiPolygon, MultiLineString, Polygon, LinearRing, LineString from shapely.ops import unary_union from io import StringIO diff --git a/appObjects/AppObjectTemplate.py b/appObjects/AppObjectTemplate.py index 73db2086..32ca0fd9 100644 --- a/appObjects/AppObjectTemplate.py +++ b/appObjects/AppObjectTemplate.py @@ -18,7 +18,7 @@ from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy from appGUI.VisPyVisuals import ShapeCollection from shapely.ops import unary_union -from shapely.geometry import Polygon, MultiPolygon, Point, LineString +from shapely import Polygon, MultiPolygon, Point, LineString from copy import deepcopy, copy import sys diff --git a/appObjects/ExcellonObject.py b/appObjects/ExcellonObject.py index bcba1428..9168ce84 100644 --- a/appObjects/ExcellonObject.py +++ b/appObjects/ExcellonObject.py @@ -21,7 +21,7 @@ import itertools import numpy as np from copy import deepcopy -from shapely.geometry import LineString +from shapely import LineString import gettext import appTranslation as fcTranslate diff --git a/appObjects/GeometryObject.py b/appObjects/GeometryObject.py index 04a72390..084fe9d0 100644 --- a/appObjects/GeometryObject.py +++ b/appObjects/GeometryObject.py @@ -15,7 +15,7 @@ from appObjects.AppObjectTemplate import FlatCAMObj, ObjectDeleted from appGUI.GUIElements import FCCheckBox from appGUI.ObjectUI import GeometryObjectUI -from shapely.geometry import MultiLineString, LinearRing, Polygon, MultiPolygon, LineString +from shapely import MultiLineString, LinearRing, Polygon, MultiPolygon, LineString from shapely.affinity import scale, translate from shapely.ops import unary_union diff --git a/appObjects/GerberObject.py b/appObjects/GerberObject.py index 4e5c038c..f610bdfa 100644 --- a/appObjects/GerberObject.py +++ b/appObjects/GerberObject.py @@ -18,7 +18,7 @@ from appObjects.AppObjectTemplate import FlatCAMObj, ObjectDeleted, ValidationEr from camlib import flatten_shapely_geometry -from shapely.geometry import MultiLineString, LinearRing, MultiPolygon, Polygon, LineString, Point +from shapely import MultiLineString, LinearRing, MultiPolygon, Polygon, LineString, Point from shapely.ops import unary_union import numpy as np diff --git a/appParsers/ParseDXF.py b/appParsers/ParseDXF.py index 9fe62ca8..6b628aeb 100644 --- a/appParsers/ParseDXF.py +++ b/appParsers/ParseDXF.py @@ -8,7 +8,7 @@ from appParsers.ParseDXF_Spline import spline2Polyline, normalize_2 from appParsers.ParseDXF_Spline import Vector as DxfVector -from shapely.geometry import LineString, Point, Polygon +from shapely import LineString, Point, Polygon from shapely.affinity import rotate, translate, scale # from ezdxf.math import Vector as ezdxf_vector from ezdxf.math import Vec3 as ezdxf_vector diff --git a/appParsers/ParseExcellon.py b/appParsers/ParseExcellon.py index 5e660e19..9bf68f1b 100644 --- a/appParsers/ParseExcellon.py +++ b/appParsers/ParseExcellon.py @@ -9,7 +9,7 @@ from camlib import Geometry, grace import shapely.affinity as affinity -from shapely.geometry import Point, LineString, LinearRing, MultiLineString, MultiPolygon +from shapely import Point, LineString, LinearRing, MultiLineString, MultiPolygon import numpy as np import re diff --git a/appParsers/ParseFont.py b/appParsers/ParseFont.py index c0dcb23b..e24e2988 100644 --- a/appParsers/ParseFont.py +++ b/appParsers/ParseFont.py @@ -15,7 +15,7 @@ import os import sys import glob -from shapely.geometry import Polygon, MultiPolygon +from shapely import Polygon, MultiPolygon from shapely.affinity import translate, scale import freetype as ft diff --git a/appParsers/ParseGerber.py b/appParsers/ParseGerber.py index 490c4107..d1a29d1a 100644 --- a/appParsers/ParseGerber.py +++ b/appParsers/ParseGerber.py @@ -11,8 +11,8 @@ from copy import deepcopy from shapely.ops import unary_union, linemerge import shapely.affinity as affinity -from shapely.geometry import box as shply_box -from shapely.geometry import LinearRing, MultiLineString, LineString, Polygon, MultiPolygon, Point +from shapely import box as shply_box +from shapely import LinearRing, MultiLineString, LineString, Polygon, MultiPolygon, Point from lxml import etree as ET import ezdxf diff --git a/appParsers/ParseHPGL2.py b/appParsers/ParseHPGL2.py index 81d1d554..0a93505c 100644 --- a/appParsers/ParseHPGL2.py +++ b/appParsers/ParseHPGL2.py @@ -16,7 +16,7 @@ from copy import deepcopy import sys from shapely.ops import unary_union -from shapely.geometry import LineString, Point +from shapely import LineString, Point import gettext import builtins diff --git a/appParsers/ParsePDF.py b/appParsers/ParsePDF.py index 3450e388..e3d6430e 100644 --- a/appParsers/ParsePDF.py +++ b/appParsers/ParsePDF.py @@ -9,7 +9,7 @@ from PyQt6 import QtCore from appCommon.Common import GracefulException as grace -from shapely.geometry import Polygon, LineString, MultiPolygon +from shapely import Polygon, LineString, MultiPolygon from copy import copy, deepcopy import numpy as np diff --git a/appParsers/ParseSVG.py b/appParsers/ParseSVG.py index c38ddef2..29550d6e 100644 --- a/appParsers/ParseSVG.py +++ b/appParsers/ParseSVG.py @@ -24,7 +24,7 @@ from svg.path import Line, Arc, CubicBezier, QuadraticBezier, parse_path # from svg.path.path import Move # from svg.path.path import Close import svg.path -from shapely.geometry import LineString, MultiLineString, Point +from shapely import LineString, MultiLineString, Point from shapely.affinity import skew, affine_transform, rotate import numpy as np diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index cfa82c13..61f2fa6c 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtGui, QtCore from appTool import AppTool from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, GLay, FCComboBox, RadioSet -from shapely.geometry import Point +from shapely import Point from shapely.affinity import translate import logging diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index efa3a4a2..e58b3028 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -20,7 +20,7 @@ import numpy as np from typing import Iterable import shapely.geometry.base as base -from shapely.geometry import Polygon, MultiPolygon, box, Point, LineString +from shapely import Polygon, MultiPolygon, box, Point, LineString from shapely.ops import unary_union from shapely.affinity import translate diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 4ebc328c..e702b7cf 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -18,7 +18,7 @@ import simplejson as json import sys from numpy import Inf -from shapely.geometry import Polygon, MultiPolygon, box, Point, LineString, MultiLineString, LinearRing +from shapely import Polygon, MultiPolygon, box, Point, LineString, MultiLineString, LinearRing from shapely.ops import unary_union, linemerge from shapely.affinity import rotate diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index 5d0e8719..65db329a 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -8,7 +8,7 @@ import logging from copy import deepcopy from numpy import Inf -from shapely.geometry import Point +from shapely import Point from shapely.affinity import scale import gettext diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 58a8c3dd..8e11f8f0 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -17,7 +17,7 @@ import logging from copy import copy import numpy as np -from shapely.geometry import Polygon, Point, LineString, MultiLineString +from shapely import Polygon, Point, LineString, MultiLineString from shapely.strtree import STRtree import gettext diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py index d7ef7ccd..d56ea5f4 100644 --- a/appPlugins/ToolDrilling.py +++ b/appPlugins/ToolDrilling.py @@ -22,7 +22,7 @@ import sys import platform import re -from shapely.geometry import LineString +from shapely import LineString import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index fe4c46d7..ae28bc38 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -13,7 +13,7 @@ from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, G import logging from copy import deepcopy -from shapely.geometry import Polygon, MultiPolygon, Point, box +from shapely import Polygon, MultiPolygon, Point, box import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index 957da7ff..bab14589 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -15,7 +15,8 @@ import logging from copy import deepcopy import math -from shapely.geometry import LineString, Polygon, MultiPolygon, box, Point, base +from shapely import LineString, Polygon, MultiPolygon, box, Point, base +from shapely.geometry import base from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index f467bb7b..39b3d469 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -14,7 +14,7 @@ import logging from copy import deepcopy import math -from shapely.geometry import LineString, MultiPolygon, Point, Polygon, LinearRing +from shapely import LineString, MultiPolygon, Point, Polygon, LinearRing from shapely.affinity import scale, skew from shapely.ops import unary_union diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index a67f9e8e..292b278c 100644 --- a/appPlugins/ToolFollow.py +++ b/appPlugins/ToolFollow.py @@ -13,7 +13,7 @@ import logging from copy import deepcopy import numpy as np -from shapely.geometry import Polygon +from shapely import Polygon from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index 96756e7e..4d33e2d8 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -14,7 +14,7 @@ from copy import deepcopy import numpy as np import os -from shapely.geometry import LineString, MultiLineString, Polygon, MultiPolygon, shape +from shapely import LineString, MultiLineString, Polygon, MultiPolygon, shape from shapely.affinity import scale, translate import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index 52e4e4d6..355617b7 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -13,7 +13,7 @@ from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, G import logging from copy import deepcopy -from shapely.geometry import box +from shapely import box import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index 3290117c..3a2e3b50 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -20,7 +20,7 @@ import simplejson as json import sys import math -from shapely.geometry import LineString, MultiLineString, Polygon, MultiPolygon, Point, LinearRing +from shapely import LineString, MultiLineString, Polygon, MultiPolygon, Point, LinearRing from shapely.ops import unary_union, nearest_points import gettext diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index 8950cff9..4e502e93 100644 --- a/appPlugins/ToolLevelling.py +++ b/appPlugins/ToolLevelling.py @@ -16,7 +16,7 @@ import logging from copy import deepcopy import sys -from shapely.geometry import Point, MultiPoint, MultiPolygon, box +from shapely import Point, MultiPoint, MultiPolygon, box from shapely.ops import unary_union from shapely.affinity import translate from datetime import datetime as dt diff --git a/appPlugins/ToolMarkers.py b/appPlugins/ToolMarkers.py index 1e858668..b415f85c 100644 --- a/appPlugins/ToolMarkers.py +++ b/appPlugins/ToolMarkers.py @@ -13,7 +13,7 @@ from appGUI.GUIElements import VerticalScrollArea, FCLabel, FCButton, FCFrame, G import logging from copy import deepcopy -from shapely.geometry import LineString, Point, MultiPolygon +from shapely import LineString, Point, MultiPolygon from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index d2c0d90d..aa2b3fa5 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -19,7 +19,7 @@ import sys import math import traceback -from shapely.geometry import LineString, box +from shapely import LineString, box import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolMove.py b/appPlugins/ToolMove.py index f513c59a..bce0f424 100644 --- a/appPlugins/ToolMove.py +++ b/appPlugins/ToolMove.py @@ -12,7 +12,7 @@ from appGUI.VisPyVisuals import ShapeCollection import logging from copy import copy -from shapely.geometry import Polygon +from shapely import Polygon import gettext import appTranslation as fcTranslate diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 5941fb1b..765e638f 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -18,7 +18,8 @@ import simplejson as json import sys import traceback -from shapely.geometry import LineString, Polygon, MultiPolygon, MultiLineString, base, LinearRing +from shapely import LineString, Polygon, MultiPolygon, MultiLineString, LinearRing +from shapely.geometry import base from shapely.ops import unary_union, nearest_points import gettext diff --git a/appPlugins/ToolObjectDistance.py b/appPlugins/ToolObjectDistance.py index bd0950af..8633c76f 100644 --- a/appPlugins/ToolObjectDistance.py +++ b/appPlugins/ToolObjectDistance.py @@ -13,7 +13,7 @@ import logging from copy import deepcopy import math -from shapely.geometry import Point, MultiPolygon +from shapely import Point, MultiPolygon from shapely.ops import nearest_points, unary_union import gettext diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index 998114cd..fb46f6ce 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -14,7 +14,7 @@ from camlib import grace import logging import numpy as np -from shapely.geometry import MultiPolygon +from shapely import MultiPolygon from shapely.ops import nearest_points import gettext diff --git a/appPlugins/ToolPDF.py b/appPlugins/ToolPDF.py index 765469f5..d26ea143 100644 --- a/appPlugins/ToolPDF.py +++ b/appPlugins/ToolPDF.py @@ -15,7 +15,7 @@ import time import re import traceback -from shapely.geometry import Point, MultiPolygon +from shapely import Point, MultiPolygon from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index e2c6a213..bb214bfc 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -22,7 +22,8 @@ import sys import traceback from numpy import Inf -from shapely.geometry import LineString, Polygon, MultiLineString, MultiPolygon, Point, LinearRing, base +from shapely import LineString, Polygon, MultiLineString, MultiPolygon, Point, LinearRing +from shapely.geometry import base from shapely.ops import unary_union, linemerge import gettext diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py index fff9a7c6..64fbc55d 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -15,7 +15,7 @@ import logging from copy import deepcopy import numpy as np -from shapely.geometry import LineString, MultiLineString, Polygon, MultiPolygon +from shapely import LineString, MultiLineString, Polygon, MultiPolygon from shapely.ops import unary_union, linemerge, snap from shapely.affinity import translate diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index e4566241..075a5928 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -15,7 +15,7 @@ from matplotlib.backend_bases import KeyEvent as mpl_key_event import logging from copy import deepcopy -from shapely.geometry import Point, MultiPolygon +from shapely import Point, MultiPolygon from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py index 6f3b39a2..a2020ee0 100644 --- a/appPlugins/ToolQRCode.py +++ b/appPlugins/ToolQRCode.py @@ -18,7 +18,7 @@ from io import StringIO, BytesIO from typing import Iterable import math -from shapely.geometry import MultiPolygon, box, Polygon +from shapely import MultiPolygon, box, Polygon from shapely.ops import unary_union from shapely.affinity import translate, scale import gettext diff --git a/appPlugins/ToolReport.py b/appPlugins/ToolReport.py index 53d16fb2..cd2653d6 100644 --- a/appPlugins/ToolReport.py +++ b/appPlugins/ToolReport.py @@ -12,7 +12,7 @@ import logging from copy import deepcopy import math -from shapely.geometry import MultiPolygon, Polygon, MultiLineString +from shapely import MultiPolygon, Polygon, MultiLineString from shapely.ops import unary_union import gettext diff --git a/appPlugins/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py index 74200339..7876feb0 100644 --- a/appPlugins/ToolRulesCheck.py +++ b/appPlugins/ToolRulesCheck.py @@ -14,7 +14,7 @@ from appObjects import GerberObject import logging from copy import deepcopy -from shapely.geometry import Polygon, MultiPolygon +from shapely import Polygon, MultiPolygon from shapely.ops import nearest_points import gettext diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index cacbca3b..e866399d 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -14,7 +14,7 @@ import traceback from copy import deepcopy import re -from shapely.geometry import LineString, MultiLineString, Polygon, MultiPolygon, Point +from shapely import LineString, MultiLineString, Polygon, MultiPolygon, Point from shapely.ops import unary_union from datetime import datetime as dt diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index fdda6e53..e651cc82 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -14,7 +14,7 @@ from copy import deepcopy import time import traceback -from shapely.geometry import LineString, Polygon, MultiPolygon, MultiLineString +from shapely import LineString, Polygon, MultiPolygon, MultiLineString from shapely.ops import unary_union import gettext diff --git a/appTool.py b/appTool.py index aadd8b59..215abcdf 100644 --- a/appTool.py +++ b/appTool.py @@ -7,7 +7,7 @@ # ########################################################## ## from PyQt6 import QtGui, QtWidgets, QtCore -from shapely.geometry import Polygon, LineString +from shapely import Polygon, LineString import gettext import appTranslation as fcTranslate diff --git a/camlib.py b/camlib.py index 892b824d..1a2f3c05 100644 --- a/camlib.py +++ b/camlib.py @@ -31,9 +31,9 @@ from io import StringIO import ezdxf # See: http://toblerity.org/shapely/manual.html -from shapely.geometry import Polygon, Point, LinearRing, MultiPoint, MultiLineString, MultiPolygon, LineString +from shapely import Polygon, Point, LinearRing, MultiPoint, MultiLineString, MultiPolygon, LineString -from shapely.geometry import box as shply_box +from shapely import box as shply_box from shapely.ops import unary_union, substring, linemerge import shapely.affinity as affinity from shapely.affinity import scale, translate diff --git a/requirements.txt b/requirements.txt index a27d4040..5fc81166 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ qrcode>=6.1 rtree # foronoi>=1.0.3 -shapely>=1.8.0 +shapely>=2.0 # ############################### # OR-TOOLS package is now optional diff --git a/tclCommands/TclCommandAddDrill.py b/tclCommands/TclCommandAddDrill.py index 2acfddab..1eced020 100644 --- a/tclCommands/TclCommandAddDrill.py +++ b/tclCommands/TclCommandAddDrill.py @@ -1,6 +1,6 @@ from tclCommands.TclCommand import * from copy import deepcopy -from shapely.geometry import Point +from shapely import Point class TclCommandAddDrill(TclCommandSignaled): diff --git a/tclCommands/TclCommandAddSlot.py b/tclCommands/TclCommandAddSlot.py index 4f43e8ab..5c60de44 100644 --- a/tclCommands/TclCommandAddSlot.py +++ b/tclCommands/TclCommandAddSlot.py @@ -1,6 +1,6 @@ from tclCommands.TclCommand import * from copy import deepcopy -from shapely.geometry import Point +from shapely import Point class TclCommandAddSlot(TclCommandSignaled): diff --git a/tclCommands/TclCommandAlignDrill.py b/tclCommands/TclCommandAlignDrill.py index e424dbe6..1fb041e9 100644 --- a/tclCommands/TclCommandAlignDrill.py +++ b/tclCommands/TclCommandAlignDrill.py @@ -1,7 +1,7 @@ import collections from tclCommands.TclCommand import TclCommandSignaled -from shapely.geometry import Point +from shapely import Point import shapely.affinity as affinity from copy import deepcopy diff --git a/tclCommands/TclCommandAlignDrillGrid.py b/tclCommands/TclCommandAlignDrillGrid.py index 6908b10c..e35a71eb 100644 --- a/tclCommands/TclCommandAlignDrillGrid.py +++ b/tclCommands/TclCommandAlignDrillGrid.py @@ -1,7 +1,7 @@ import collections from tclCommands.TclCommand import TclCommandSignaled -from shapely.geometry import Point +from shapely import Point from copy import deepcopy diff --git a/tclCommands/TclCommandCutout.py b/tclCommands/TclCommandCutout.py index c7513113..a9ad85e9 100644 --- a/tclCommands/TclCommandCutout.py +++ b/tclCommands/TclCommandCutout.py @@ -5,7 +5,7 @@ from tclCommands.TclCommand import TclCommand import collections from copy import deepcopy -from shapely.geometry import box +from shapely import box from shapely.ops import linemerge from camlib import flatten_shapely_geometry diff --git a/tclCommands/TclCommandGeoCutout.py b/tclCommands/TclCommandGeoCutout.py index e64ec8bd..134b70f9 100644 --- a/tclCommands/TclCommandGeoCutout.py +++ b/tclCommands/TclCommandGeoCutout.py @@ -4,7 +4,7 @@ import logging import collections from copy import deepcopy from shapely.ops import unary_union -from shapely.geometry import Polygon, LineString, LinearRing, MultiPolygon, MultiLineString +from shapely import Polygon, LineString, LinearRing, MultiPolygon, MultiLineString import gettext import appTranslation as fcTranslate diff --git a/tclCommands/TclCommandPanelize.py b/tclCommands/TclCommandPanelize.py index 6e3f4f58..d9a62854 100644 --- a/tclCommands/TclCommandPanelize.py +++ b/tclCommands/TclCommandPanelize.py @@ -1,7 +1,7 @@ from tclCommands.TclCommand import TclCommand import shapely.affinity as affinity -from shapely.geometry import MultiPolygon, MultiLineString +from shapely import MultiPolygon, MultiLineString import logging from copy import deepcopy