- fixed some possible issues due of changes in version 2.0 of Shapely
- removed the import * statement from most of the app
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
# Modified by Marius Stanciu (2020) #
|
||||
# ###########################################################
|
||||
|
||||
from appObjects.ObjectCollection import *
|
||||
from PyQt6 import QtCore
|
||||
|
||||
from appObjects.CNCJobObject import CNCJobObject
|
||||
from appObjects.DocumentObject import DocumentObject
|
||||
from appObjects.ExcellonObject import ExcellonObject
|
||||
@@ -17,6 +18,7 @@ from appObjects.ScriptObject import ScriptObject
|
||||
|
||||
import time
|
||||
import traceback
|
||||
from copy import deepcopy
|
||||
|
||||
# FlatCAM Translation
|
||||
import gettext
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
# import inspect
|
||||
|
||||
from appGUI.ObjectUI import *
|
||||
from PyQt6 import QtCore, QtGui
|
||||
|
||||
from appGUI.ObjectUI import ObjectUI
|
||||
from appCommon.Common import LoudDict
|
||||
from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy
|
||||
from appGUI.VisPyVisuals import ShapeCollection
|
||||
@@ -21,9 +20,10 @@ from appGUI.VisPyVisuals import ShapeCollection
|
||||
from shapely.ops import unary_union
|
||||
from shapely.geometry import Polygon, MultiPolygon, Point, LineString
|
||||
|
||||
from copy import deepcopy
|
||||
from copy import deepcopy, copy
|
||||
import sys
|
||||
import math
|
||||
import inspect
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
@@ -211,12 +211,12 @@ class FlatCAMObj(QtCore.QObject):
|
||||
|
||||
@property
|
||||
def visible(self):
|
||||
'''
|
||||
"""
|
||||
This property is used by Editors to turn off plotting for the original object that is edited,
|
||||
such that when deleting certain elements there is no background plot in place to confuse things.
|
||||
:return:
|
||||
:rtype:
|
||||
'''
|
||||
"""
|
||||
return self.shapes.visible
|
||||
|
||||
@visible.setter
|
||||
@@ -227,6 +227,7 @@ class FlatCAMObj(QtCore.QObject):
|
||||
|
||||
current_visibility = self.shapes.visible
|
||||
self.shapes.visible = current_visibility # maybe this is slower in VisPy? use enabled property?
|
||||
|
||||
def task(visibility):
|
||||
if visibility is True:
|
||||
if value is False:
|
||||
@@ -666,7 +667,7 @@ class FlatCAMObj(QtCore.QObject):
|
||||
if isinstance(geo, list) and geo[0] is not None:
|
||||
if isinstance(geo, MultiPolygon):
|
||||
env_obj = geo.convex_hull
|
||||
elif (isinstance(geo, MultiPolygon) and len(geo) == 1) or \
|
||||
elif (isinstance(geo, MultiPolygon) and len(geo.geoms) == 1) or \
|
||||
(isinstance(geo, list) and len(geo) == 1) and isinstance(geo[0], Polygon):
|
||||
env_obj = unary_union(geo)
|
||||
env_obj = env_obj.convex_hull
|
||||
|
||||
@@ -10,17 +10,22 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
from io import StringIO
|
||||
from datetime import datetime
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
from appEditors.AppTextEditor import AppTextEditor
|
||||
from appObjects.AppObjectTemplate import *
|
||||
|
||||
from appObjects.AppObjectTemplate import FlatCAMObj, ObjectDeleted
|
||||
from appGUI.GUIElements import FCFileSaveDialog, FCCheckBox
|
||||
from appGUI.ObjectUI import CNCObjectUI
|
||||
from camlib import CNCjob
|
||||
|
||||
import os
|
||||
import sys
|
||||
import math
|
||||
import re
|
||||
|
||||
from io import StringIO
|
||||
from datetime import datetime as dt
|
||||
from copy import deepcopy
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
@@ -855,7 +860,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||
"""
|
||||
|
||||
self.app.log.debug("FlatCAMCNCJob.gcode_header()")
|
||||
time_str = "{:%A, %d %B %Y at %H:%M}".format(datetime.now())
|
||||
time_str = "{:%A, %d %B %Y at %H:%M}".format(dt.now())
|
||||
marlin = False
|
||||
hpgl = False
|
||||
probe_pp = False
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
# ##########################################################
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
|
||||
from appEditors.AppTextEditor import AppTextEditor
|
||||
from appObjects.AppObjectTemplate import *
|
||||
from appGUI.ObjectUI import DocumentObjectUI
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
|
||||
@@ -10,14 +10,18 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
|
||||
from shapely.geometry import LineString
|
||||
from PyQt6 import QtWidgets, QtCore, QtGui
|
||||
|
||||
from appParsers.ParseExcellon import Excellon
|
||||
from appObjects.AppObjectTemplate import *
|
||||
from appObjects.AppObjectTemplate import FlatCAMObj, ObjectDeleted
|
||||
from appGUI.GUIElements import FCCheckBox
|
||||
from appGUI.ObjectUI import ExcellonObjectUI
|
||||
|
||||
import itertools
|
||||
import numpy as np
|
||||
from copy import deepcopy
|
||||
|
||||
from shapely.geometry import LineString
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
|
||||
@@ -10,17 +10,22 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
from shapely.geometry import MultiLineString, LinearRing
|
||||
import shapely.affinity as affinity
|
||||
from PyQt6 import QtWidgets, QtCore
|
||||
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.affinity import scale, translate
|
||||
from shapely.ops import unary_union
|
||||
|
||||
from camlib import Geometry, flatten_shapely_geometry
|
||||
|
||||
from appObjects.AppObjectTemplate import *
|
||||
|
||||
import re
|
||||
import ezdxf
|
||||
import numpy as np
|
||||
from copy import deepcopy
|
||||
import traceback
|
||||
from copy import deepcopy
|
||||
from collections import defaultdict
|
||||
from functools import reduce
|
||||
|
||||
@@ -1193,7 +1198,7 @@ class GeometryObject(FlatCAMObj, Geometry):
|
||||
self.app.proc_container.update_view_text(' %d%%' % disp_number)
|
||||
self.old_disp_number = disp_number
|
||||
|
||||
return affinity.scale(geom, xfactor, yfactor, origin=(px, py))
|
||||
return scale(geom, xfactor, yfactor, origin=(px, py))
|
||||
except AttributeError:
|
||||
return geom
|
||||
|
||||
@@ -1269,7 +1274,7 @@ class GeometryObject(FlatCAMObj, Geometry):
|
||||
self.app.proc_container.update_view_text(' %d%%' % disp_number)
|
||||
self.old_disp_number = disp_number
|
||||
|
||||
return affinity.translate(geom, xoff=dx, yoff=dy)
|
||||
return translate(geom, xoff=dx, yoff=dy)
|
||||
except AttributeError:
|
||||
return geom
|
||||
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
from PyQt6 import QtWidgets, QtCore
|
||||
from appGUI.GUIElements import FCCheckBox
|
||||
from appGUI.ObjectUI import GerberObjectUI
|
||||
from appParsers.ParseGerber import Gerber
|
||||
from appObjects.AppObjectTemplate import FlatCAMObj, ObjectDeleted, ValidationError
|
||||
|
||||
from shapely.geometry import MultiLineString, LinearRing
|
||||
from camlib import flatten_shapely_geometry
|
||||
|
||||
from appParsers.ParseGerber import Gerber
|
||||
from appObjects.AppObjectTemplate import *
|
||||
from shapely.geometry import MultiLineString, LinearRing, MultiPolygon, Polygon, LineString, Point
|
||||
from shapely.ops import unary_union
|
||||
|
||||
import numpy as np
|
||||
from copy import deepcopy
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
# File modified by: Marius Stanciu #
|
||||
# ##########################################################
|
||||
|
||||
from PyQt6 import QtCore
|
||||
|
||||
from appEditors.AppTextEditor import AppTextEditor
|
||||
from appObjects.AppObjectTemplate import *
|
||||
from appGUI.ObjectUI import *
|
||||
from appObjects.AppObjectTemplate import FlatCAMObj
|
||||
from appGUI.ObjectUI import ScriptObjectUI
|
||||
|
||||
import gettext
|
||||
import appTranslation as fcTranslate
|
||||
|
||||
Reference in New Issue
Block a user