- refactored the imports in the Plugins, moved almost all imports in the AppTool file

- fixed a number of issues, mostly leftovers from moving the UI of a Plugin in its own class
- fixed some bugs in the Punch Gerber plugin
- fixed some bugs where the 'pool' parameter was not passed when creating shapes collections (in 3D graphic mode); I wonder how it worked until now
- added a new feature in the Isolation Plugin: now for all the isolation Geometry objects this plugin can do a supplementary simplification of the geometry using the tolerance parameter defined in the General Parameters. This should lead to a reduced number of tool lifts when doing corners
This commit is contained in:
Marius Stanciu
2022-03-31 19:28:19 +03:00
committed by Marius Stanciu
parent e1824a09f7
commit ada48269a9
43 changed files with 378 additions and 797 deletions

View File

@@ -5,28 +5,10 @@
# MIT Licence #
# ##########################################################
from PyQt6 import QtWidgets, QtGui, QtCore
from appTool import AppTool
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton, \
FCLabel, VerticalScrollArea, FCGridLayout, FCFrame, FCComboBox2
from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing, MultiLineString, Point
from shapely.ops import unary_union, linemerge
import shapely.affinity as affinity
from camlib import flatten_shapely_geometry
from appTool import *
from camlib import grace, flatten_shapely_geometry
from matplotlib.backend_bases import KeyEvent as mpl_key_event
from numpy import Inf
from copy import deepcopy
import math
import logging
import gettext
import sys
import simplejson as json
import appTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
@@ -1168,8 +1150,8 @@ class CutOut(AppTool):
except TypeError:
gaps_solid_geo.append(self_c.subtract_geo(geom_struct, c_geo))
elif cutout_obj.kind == 'gerber' and margin < 0:
msg = '[WARNING_NOTCL] %s' % _("Rectangular cutout with negative margin is not possible.")
app_obj.inform.emit(msg)
mesg = '[WARNING_NOTCL] %s' % _("Rectangular cutout with negative margin is not possible.")
app_obj.inform.emit(mesg)
return "fail"
if not solid_geo:
@@ -1982,7 +1964,7 @@ class CutOut(AppTool):
# rotate only if there is an angle to rotate to
if rot_angle != 0:
cut_geo = affinity.rotate(cut_geo, -rot_angle)
cut_geo = rotate(cut_geo, -rot_angle)
# Remove any previous utility shape
self.app.geo_editor.tool_shape.clear(update=True)
@@ -2157,7 +2139,7 @@ class CutOut(AppTool):
maxx = -Inf
maxy = -Inf
work_geo = obj.geoms if isinstance(obj , (MultiPolygon, MultiLineString)) else obj
work_geo = obj.geoms if isinstance(obj, (MultiPolygon, MultiLineString)) else obj
for k in work_geo:
minx_, miny_, maxx_, maxy_ = bounds_rec(k)
minx = min(minx, minx_)