Merge branch 'Beta' into preferences-refactoring

This commit is contained in:
David Robertson 2020-05-03 23:19:40 +01:00
commit 20c4c12f17
41 changed files with 13360 additions and 11390 deletions

View File

@ -7,6 +7,20 @@ CHANGELOG for FlatCAM beta
=================================================
3.05.2020
- small changes to allow making the x86 installer that is made from a Python 3.5 run FlatCAM beta
- fixed multiple parameter 'outname' in the Tcl commands OpenGerber and OpenGcode
- added more examples in the scripts Examples: isolate and cutout examples
- updated the Italian translation
- updated the translation files
- changed the line endings for Makefile and setup_ubuntu.sh files
- protected a dict in VispyVisuals from issuing errors of keys changed while iterating through it
2.05.2020
- working on a new feature: adding interdiction area for Gcode generation. They will be added in the Geometry Object
2.05.2020
- changed the icons for the grid snap in the status bar
@ -17,7 +31,7 @@ CHANGELOG for FlatCAM beta
- modified the Cutout Tool to generate multi-geo objects therefore the set geometry parameters will populate the Geometry Object UI
- modified the Panelize Tool to optimize the output from Cutout Tool such that there are no longer overlapping cuts
- some string corrections
- updated the Italian translation done by user @pcb-hobbyst
- updated the Italian translation done by user @pcb-hobbyst (Golfetto Massimiliano)
- RELEASE 8.992
01.05.2020

View File

@ -162,9 +162,10 @@ class App(QtCore.QObject):
# ###############################################################################################################
# ################################### Version and VERSION DATE ##################################################
# ###############################################################################################################
version = 8.992
version_date = "2020/05/03"
version = 8.993
version_date = "2020/08/01"
beta = True
engine = '3D'
# current date now

View File

@ -49,7 +49,7 @@ def load_languages():
available_translations = next(os.walk(languages_path_search))[1]
except StopIteration:
if not available_translations:
languages_path_search = os.path.join(Path(__file__).parents[1], 'locale')
languages_path_search = os.path.join(str(Path(__file__).parents[1]), 'locale')
try:
available_translations = next(os.walk(languages_path_search))[1]
except StopIteration:

View File

@ -0,0 +1,28 @@
# #####################################################################################
# DESCRIPTION:
# Will cut a PCB piece with a pattern (Gerber file) out of the surrounding PCB material
# #####################################################################################
puts "**************** RUNNING an EXAMPLE SCRIPT = Cutout a Gerber file *******************"
# ----------- START: This is needed only for the examples ----------------
# first set the default location where to search for the files to be open and store it to the ROOT_FOLDER variable
set ROOT_FOLDER [get_sys root_folder_path]
# calculate the resources path for the examples we need to run and store it inside the PATH varaible
set PATH ${ROOT_FOLDER}/assets/examples/files
# ----------- END: This is needed only for the examples ----------------
# set the working path to the path that holds the files we are going to work with
set_path $PATH
# load the GERBER file test.gbr as gerber_file
open_gerber test.gbr -outname gerber_file
# cutout the Gerber file with name gerber_file using an endmill with diameter 1.2 at a distance of 0.1 units from
# the Gerber object. Will add gaps (bridges to hold the PCB to the surrounding material) on each side of the PCB
# (4 sides) and the resulting Geometry object that hold the cutout geometry will be named cutout_geo
cutout gerber_file -dia 1.2 -margin 0.1 -gapsize 3 -gaps "4" -outname cutout_geo
# plot the objects so we can see them; not required for the script but in this script we want to see the results
plot_all

View File

@ -0,0 +1,26 @@
# #####################################################################################
# DESCRIPTION:
# Will isolate copper features in a Gerber file by creating surrounding paths around
# #####################################################################################
puts "**************** RUNNING an EXAMPLE SCRIPT = Isolate a Gerber file *******************"
# ----------- START: This is needed only for the examples ----------------
# first set the default location where to search for the files to be open and store it to the ROOT_FOLDER variable
set ROOT_FOLDER [get_sys root_folder_path]
# calculate the resources path for the examples we need to run and store it inside the PATH varaible
set PATH ${ROOT_FOLDER}/assets/examples/files
# ----------- END: This is needed only for the examples ----------------
# set the working path to the path that holds the files we are going to work with
set_path $PATH
# load the GERBER file
open_gerber test.gbr -outname gerber_file
# isolate the Gerber file
isolate gerber_file -dia 0.1 -passes 2 -overlap 90 -combine True -outname iso_geo
# plot the objects so we can see them; not required for the script but in this script we want to see the results
plot_all

View File

@ -1,3 +1,10 @@
# #####################################################################################
# DESCRIPTION:
# Will open a Gerber (and Excellon) file in FlatCAM
# #####################################################################################
puts "**************** RUNNING an EXAMPLE SCRIPT = Open a file *******************"
# ----------- START: This is needed only for the examples ----------------
# first set the default location where to search for the files to be open and store it to the ROOT_FOLDER variable
set ROOT_FOLDER [get_sys root_folder_path]
@ -9,11 +16,11 @@ set PATH ${ROOT_FOLDER}/assets/examples/files
# set the working path to the path that holds the files we are going to work with
set_path $PATH
# load the GERBER file
open_gerber test.gbr
# load the GERBER file and rename it to a known name so we can use it further
open_gerber test.gbr -outname gerber_obj
# load the Excellon ifle
open_excellon test.txt
# load the Excellon file and rename it to a known name so we can use it further
open_excellon test.txt -outname excellon_obj
# plot them all so we can see them on canvas
plot_all

View File

@ -341,6 +341,10 @@ class FlatCAMDefaults:
"geometry_feedrate_probe": 75,
"geometry_segx": 0.0,
"geometry_segy": 0.0,
"geometry_area_exclusion": False,
"geometry_area_shape": "polygon",
"geometry_area_strategy": "over",
"geometry_area_overz": 1.0,
# Geometry Editor
"geometry_editor_sel_limit": 30,

View File

@ -4146,6 +4146,29 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Jump to coords
if key == QtCore.Qt.Key_J:
self.app.on_jump_to()
elif self.app.call_source == 'geometry':
if modifiers == QtCore.Qt.ControlModifier:
pass
elif modifiers == QtCore.Qt.AltModifier:
pass
elif modifiers == QtCore.Qt.ShiftModifier:
pass
# NO MODIFIER
elif modifiers == QtCore.Qt.NoModifier:
if key == QtCore.Qt.Key_Escape or key == 'Escape':
sel_obj = self.app.collection.get_active()
assert sel_obj.kind == 'geometry', "Expected a Geometry Object, got %s" % type(sel_obj)
sel_obj.area_disconnect()
return
if key == QtCore.Qt.Key_G or key == 'G':
self.app.ui.grid_snap_btn.trigger()
return
# Jump to coords
if key == QtCore.Qt.Key_J or key == 'J':
self.app.on_jump_to()
def createPopupMenu(self):
menu = super().createPopupMenu()

View File

@ -2022,14 +2022,94 @@ class GeometryObjectUI(ObjectUI):
grid4.addWidget(pp_label, 11, 0)
grid4.addWidget(self.pp_geometry_name_cb, 11, 1)
grid4.addWidget(QtWidgets.QLabel(''), 12, 0, 1, 2)
# grid4.addWidget(QtWidgets.QLabel(''), 12, 0, 1, 2)
# Exclusion Areas
self.exclusion_cb = FCCheckBox('%s:' % _("Exclusion areas"))
self.exclusion_cb.setToolTip(
_(
"Include exclusion areas.\n"
"In those areas the travel of the tools\n"
"is forbidden."
)
)
grid4.addWidget(self.exclusion_cb, 12, 0, 1, 2)
# ------------------------------------------------------------------------------------------------------------
# ------------------------- EXCLUSION AREAS ------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
self.exclusion_frame = QtWidgets.QFrame()
self.exclusion_frame.setContentsMargins(0, 0, 0, 0)
grid4.addWidget(self.exclusion_frame, 14, 0, 1, 2)
self.exclusion_box = QtWidgets.QVBoxLayout()
self.exclusion_box.setContentsMargins(0, 0, 0, 0)
self.exclusion_frame.setLayout(self.exclusion_box)
h_lay = QtWidgets.QHBoxLayout()
self.exclusion_box.addLayout(h_lay)
# Button Add Area
self.add_area_button = QtWidgets.QPushButton(_('Add area'))
self.add_area_button.setToolTip(_("Add an Exclusion Area."))
h_lay.addWidget(self.add_area_button)
# Button Delete Area
self.delete_area_button = QtWidgets.QPushButton(_('Clear areas'))
self.delete_area_button.setToolTip(_("Delete all exclusion areas."))
h_lay.addWidget(self.delete_area_button)
grid_l = QtWidgets.QGridLayout()
grid_l.setColumnStretch(0, 0)
grid_l.setColumnStretch(1, 1)
self.exclusion_box.addLayout(grid_l)
# Area Selection shape
self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
_("The kind of selection shape used for area selection.")
)
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid_l.addWidget(self.area_shape_label, 0, 0)
grid_l.addWidget(self.area_shape_radio, 0, 1)
# Chose Strategy
self.strategy_label = FCLabel('%s:' % _("Strategy"))
self.strategy_label.setToolTip(_("The strategy followed when encountering an exclusion area.\n"
"Can be:\n"
"- Over -> when encountering the area, the tool will go to a set height\n"
"- Around -> will avoid the exclusion area by going around the area"))
self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'},
{'label': _('Around'), 'value': 'around'}])
grid_l.addWidget(self.strategy_label, 1, 0)
grid_l.addWidget(self.strategy_radio, 1, 1)
# Over Z
self.over_z_label = FCLabel('%s:' % _("Over Z"))
self.over_z_label.setToolTip(_("The height Z to which the tool will rise in order to avoid\n"
"an interdiction area."))
self.over_z_entry = FCDoubleSpinner()
self.over_z_entry.set_range(0.000, 9999.9999)
self.over_z_entry.set_precision(self.decimals)
grid_l.addWidget(self.over_z_label, 2, 0)
grid_l.addWidget(self.over_z_entry, 2, 1)
# -------------------------- EXCLUSION AREAS END -------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
self.ois_exclusion_geo = OptionalInputSection(self.exclusion_cb, [self.exclusion_frame])
warning_lbl = QtWidgets.QLabel(
_(
"Add / Select at least one tool in the tool-table.\n"
"Click the # header to select all, or Ctrl + LMB\n"
"for custom selection of tools."
))
grid4.addWidget(warning_lbl, 13, 0, 1, 2)
grid4.addWidget(warning_lbl, 15, 0, 1, 2)
# Button
self.generate_cnc_button = QtWidgets.QPushButton(_('Generate CNCJob object'))
@ -2042,9 +2122,9 @@ class GeometryObjectUI(ObjectUI):
font-weight: bold;
}
""")
grid4.addWidget(self.generate_cnc_button, 14, 0, 1, 2)
grid4.addWidget(self.generate_cnc_button, 17, 0, 1, 2)
grid4.addWidget(QtWidgets.QLabel(''), 15, 0, 1, 2)
grid4.addWidget(QtWidgets.QLabel(''), 19, 0, 1, 2)
# ##############
# Paint area ##
@ -2053,7 +2133,7 @@ class GeometryObjectUI(ObjectUI):
self.tools_label.setToolTip(
_("Launch Paint Tool in Tools Tab.")
)
grid4.addWidget(self.tools_label, 16, 0, 1, 2)
grid4.addWidget(self.tools_label, 20, 0, 1, 2)
# Paint Button
self.paint_tool_button = QtWidgets.QPushButton(_('Paint Tool'))
@ -2071,7 +2151,7 @@ class GeometryObjectUI(ObjectUI):
font-weight: bold;
}
""")
grid4.addWidget(self.paint_tool_button, 17, 0, 1, 2)
grid4.addWidget(self.paint_tool_button, 22, 0, 1, 2)
# NCC Tool
self.generate_ncc_button = QtWidgets.QPushButton(_('NCC Tool'))
@ -2085,7 +2165,7 @@ class GeometryObjectUI(ObjectUI):
font-weight: bold;
}
""")
grid4.addWidget(self.generate_ncc_button, 18, 0, 1, 2)
grid4.addWidget(self.generate_ncc_button, 24, 0, 1, 2)
class CNCObjectUI(ObjectUI):

View File

@ -462,7 +462,7 @@ class ShapeCollectionVisual(CompoundVisual):
self.update_lock.acquire(True)
# Merge shapes buffers
for data in self.data.values():
for data in list(self.data.values()):
if data['visible'] and 'line_pts' in data:
try:
line_pts[data['layer']] += data['line_pts']

View File

@ -237,6 +237,10 @@ class PreferencesUIManager:
"geometry_f_plunge": self.ui.geometry_defaults_form.geometry_adv_opt_group.fplunge_cb,
"geometry_segx": self.ui.geometry_defaults_form.geometry_adv_opt_group.segx_entry,
"geometry_segy": self.ui.geometry_defaults_form.geometry_adv_opt_group.segy_entry,
"geometry_area_exclusion": self.ui.geometry_defaults_form.geometry_adv_opt_group.exclusion_cb,
"geometry_area_shape": self.ui.geometry_defaults_form.geometry_adv_opt_group.area_shape_radio,
"geometry_area_strategy": self.ui.geometry_defaults_form.geometry_adv_opt_group.strategy_radio,
"geometry_area_overz": self.ui.geometry_defaults_form.geometry_adv_opt_group.over_z_entry,
# Geometry Editor
"geometry_editor_sel_limit": self.ui.geometry_defaults_form.geometry_editor_group.sel_limit_entry,

View File

@ -1,7 +1,7 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from flatcamGUI.GUIElements import FCEntry, FloatEntry, FCDoubleSpinner, FCCheckBox, RadioSet
from flatcamGUI.GUIElements import FCEntry, FloatEntry, FCDoubleSpinner, FCCheckBox, RadioSet, FCLabel
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@ -185,4 +185,61 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
grid1.addWidget(segy_label, 11, 0)
grid1.addWidget(self.segy_entry, 11, 1)
# -----------------------------
# --- Area Exclusion ----------
# -----------------------------
self.adv_label = QtWidgets.QLabel('<b>%s:</b>' % _('Area Exclusion'))
self.adv_label.setToolTip(
_("Area exclusion parameters.\n"
"Those parameters are available only for\n"
"Advanced App. Level.")
)
grid1.addWidget(self.adv_label, 12, 0, 1, 2)
# Exclusion Area CB
self.exclusion_cb = FCCheckBox('%s:' % _("Exclusion areas"))
self.exclusion_cb.setToolTip(
_(
"Include exclusion areas.\n"
"In those areas the travel of the tools\n"
"is forbidden."
)
)
grid1.addWidget(self.exclusion_cb, 13, 0, 1, 2)
# Area Selection shape
self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
_("The kind of selection shape used for area selection.")
)
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid1.addWidget(self.area_shape_label, 14, 0)
grid1.addWidget(self.area_shape_radio, 14, 1)
# Chose Strategy
self.strategy_label = FCLabel('%s:' % _("Strategy"))
self.strategy_label.setToolTip(_("The strategy followed when encountering an exclusion area.\n"
"Can be:\n"
"- Over -> when encountering the area, the tool will go to a set height\n"
"- Around -> will avoid the exclusion area by going around the area"))
self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'},
{'label': _('Around'), 'value': 'around'}])
grid1.addWidget(self.strategy_label, 15, 0)
grid1.addWidget(self.strategy_radio, 15, 1)
# Over Z
self.over_z_label = FCLabel('%s:' % _("Over Z"))
self.over_z_label.setToolTip(_("The height Z to which the tool will rise in order to avoid\n"
"an interdiction area."))
self.over_z_entry = FCDoubleSpinner()
self.over_z_entry.set_range(0.000, 9999.9999)
self.over_z_entry.set_precision(self.decimals)
grid1.addWidget(self.over_z_label, 18, 0)
grid1.addWidget(self.over_z_entry, 18, 1)
self.layout.addStretch()

View File

@ -16,6 +16,7 @@ import shapely.affinity as affinity
from camlib import Geometry
from flatcamObjects.FlatCAMObj import *
import FlatCAMTool
import ezdxf
import math
@ -68,6 +69,10 @@ class GeometryObject(FlatCAMObj, Geometry):
"extracut_length": 0.1,
"endz": 2.0,
"endxy": '',
"area_exclusion": False,
"area_shape": "polygon",
"area_strategy": "over",
"area_overz": 1.0,
"startz": None,
"toolchange": False,
@ -146,6 +151,18 @@ class GeometryObject(FlatCAMObj, Geometry):
self.param_fields = {}
# Event signals disconnect id holders
self.mr = None
self.mm = None
self.kp = None
# variables to be used in area exclusion
self.cursor_pos = (0, 0)
self.exclusion_areas_list = []
self.first_click = False
self.points = []
self.poly_drawn = False
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
@ -344,7 +361,11 @@ class GeometryObject(FlatCAMObj, Geometry):
"toolchangez": self.ui.toolchangez_entry,
"endz": self.ui.endz_entry,
"endxy": self.ui.endxy_entry,
"cnctooldia": self.ui.addtool_entry
"cnctooldia": self.ui.addtool_entry,
"area_exclusion": self.ui.exclusion_cb,
"area_shape":self.ui.area_shape_radio,
"area_strategy": self.ui.strategy_radio,
"area_overz": self.ui.over_z_entry,
})
self.param_fields.update({
@ -402,6 +423,10 @@ class GeometryObject(FlatCAMObj, Geometry):
"toolchangez": None,
"endz": None,
"endxy": '',
"area_exclusion": None,
"area_shape": None,
"area_strategy": None,
"area_overz": None,
"spindlespeed": 0,
"toolchangexy": None,
"startz": None
@ -522,6 +547,9 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui.apply_param_to_all.clicked.connect(self.on_apply_param_to_all_clicked)
self.ui.cutz_entry.returnPressed.connect(self.on_cut_z_changed)
self.ui.add_area_button.clicked.connect(self.on_add_area_click)
self.ui.delete_area_button.clicked.connect(self.on_clear_area_click)
def on_cut_z_changed(self):
self.old_cutz = self.ui.cutz_entry.get_value()
@ -2545,6 +2573,219 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui.plot_cb.setChecked(True)
self.ui_connect()
def on_add_area_click(self):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the start point of the area."))
self.app.call_source = 'geometry'
if self.app.is_legacy is False:
self.app.plotcanvas.graph_event_disconnect('mouse_press', self.app.on_mouse_click_over_plot)
self.app.plotcanvas.graph_event_disconnect('mouse_move', self.app.on_mouse_move_over_plot)
self.app.plotcanvas.graph_event_disconnect('mouse_release', self.app.on_mouse_click_release_over_plot)
else:
self.app.plotcanvas.graph_event_disconnect(self.app.mp)
self.app.plotcanvas.graph_event_disconnect(self.app.mm)
self.app.plotcanvas.graph_event_disconnect(self.app.mr)
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_mouse_release)
self.mm = self.app.plotcanvas.graph_event_connect('mouse_move', self.on_mouse_move)
# self.kp = self.app.plotcanvas.graph_event_connect('key_press', self.on_key_press)
# To be called after clicking on the plot.
def on_mouse_release(self, event):
if self.app.is_legacy is False:
event_pos = event.pos
# event_is_dragging = event.is_dragging
right_button = 2
else:
event_pos = (event.xdata, event.ydata)
# event_is_dragging = self.app.plotcanvas.is_dragging
right_button = 3
event_pos = self.app.plotcanvas.translate_coords(event_pos)
if self.app.grid_status():
curr_pos = self.app.geo_editor.snap(event_pos[0], event_pos[1])
else:
curr_pos = (event_pos[0], event_pos[1])
x1, y1 = curr_pos[0], curr_pos[1]
shape_type = self.ui.area_shape_radio.get_value()
# do clear area only for left mouse clicks
if event.button == 1:
if shape_type == "square":
if self.first_click is False:
self.first_click = True
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the end point of the area."))
self.cursor_pos = self.app.plotcanvas.translate_coords(event_pos)
if self.app.grid_status():
self.cursor_pos = self.app.geo_editor.snap(event_pos[0], event_pos[1])
else:
self.app.inform.emit(_("Zone added. Click to start adding next zone or right click to finish."))
self.app.delete_selection_shape()
x0, y0 = self.cursor_pos[0], self.cursor_pos[1]
pt1 = (x0, y0)
pt2 = (x1, y0)
pt3 = (x1, y1)
pt4 = (x0, y1)
new_rectangle = Polygon([pt1, pt2, pt3, pt4])
self.exclusion_areas_list.append(new_rectangle)
# add a temporary shape on canvas
FlatCAMTool.FlatCAMTool.draw_tool_selection_shape(self, old_coords=(x0, y0), coords=(x1, y1))
self.first_click = False
return
else:
self.points.append((x1, y1))
if len(self.points) > 1:
self.poly_drawn = True
self.app.inform.emit(_("Click on next Point or click right mouse button to complete ..."))
return ""
elif event.button == right_button and self.mouse_is_dragging is False:
shape_type = self.ui.area_shape_radio.get_value()
if shape_type == "square":
self.first_click = False
else:
# if we finish to add a polygon
if self.poly_drawn is True:
try:
# try to add the point where we last clicked if it is not already in the self.points
last_pt = (x1, y1)
if last_pt != self.points[-1]:
self.points.append(last_pt)
except IndexError:
pass
# we need to add a Polygon and a Polygon can be made only from at least 3 points
if len(self.points) > 2:
FlatCAMTool.FlatCAMTool.delete_moving_selection_shape(self)
pol = Polygon(self.points)
# do not add invalid polygons even if they are drawn by utility geometry
if pol.is_valid:
self.exclusion_areas_list.append(pol)
FlatCAMTool.FlatCAMTool.draw_selection_shape_polygon(self, points=self.points)
self.app.inform.emit(
_("Zone added. Click to start adding next zone or right click to finish."))
self.points = []
self.poly_drawn = False
return
FlatCAMTool.FlatCAMTool.delete_tool_selection_shape(self)
if self.app.is_legacy is False:
self.app.plotcanvas.graph_event_disconnect('mouse_release', self.on_mouse_release)
self.app.plotcanvas.graph_event_disconnect('mouse_move', self.on_mouse_move)
# self.app.plotcanvas.graph_event_disconnect('key_press', self.on_key_press)
else:
self.app.plotcanvas.graph_event_disconnect(self.mr)
self.app.plotcanvas.graph_event_disconnect(self.mm)
# self.app.plotcanvas.graph_event_disconnect(self.kp)
self.app.mp = self.app.plotcanvas.graph_event_connect('mouse_press',
self.app.on_mouse_click_over_plot)
self.app.mm = self.app.plotcanvas.graph_event_connect('mouse_move',
self.app.on_mouse_move_over_plot)
self.app.mr = self.app.plotcanvas.graph_event_connect('mouse_release',
self.app.on_mouse_click_release_over_plot)
self.app.call_source = 'app'
if len(self.exclusion_areas_list) == 0:
return
def area_disconnect(self):
if self.app.is_legacy is False:
self.app.plotcanvas.graph_event_disconnect('mouse_release', self.on_mouse_release)
self.app.plotcanvas.graph_event_disconnect('mouse_move', self.on_mouse_move)
else:
self.app.plotcanvas.graph_event_disconnect(self.mr)
self.app.plotcanvas.graph_event_disconnect(self.mm)
self.app.plotcanvas.graph_event_disconnect(self.kp)
self.app.mp = self.app.plotcanvas.graph_event_connect('mouse_press',
self.app.on_mouse_click_over_plot)
self.app.mm = self.app.plotcanvas.graph_event_connect('mouse_move',
self.app.on_mouse_move_over_plot)
self.app.mr = self.app.plotcanvas.graph_event_connect('mouse_release',
self.app.on_mouse_click_release_over_plot)
self.points = []
self.poly_drawn = False
self.exclusion_areas_list = []
FlatCAMTool.FlatCAMTool.delete_moving_selection_shape(self)
FlatCAMTool.FlatCAMTool.delete_tool_selection_shape(self)
self.app.call_source = "app"
self.app.inform.emit("[WARNING_NOTCL] %s" % _("Cancelled. Area exclusion drawing was interrupted."))
# called on mouse move
def on_mouse_move(self, event):
shape_type = self.ui.area_shape_radio.get_value()
if self.app.is_legacy is False:
event_pos = event.pos
event_is_dragging = event.is_dragging
# right_button = 2
else:
event_pos = (event.xdata, event.ydata)
event_is_dragging = self.app.plotcanvas.is_dragging
# right_button = 3
curr_pos = self.app.plotcanvas.translate_coords(event_pos)
# detect mouse dragging motion
if event_is_dragging is True:
self.mouse_is_dragging = True
else:
self.mouse_is_dragging = False
# update the cursor position
if self.app.grid_status():
# Update cursor
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])
self.app.app_cursor.set_data(np.asarray([(curr_pos[0], curr_pos[1])]),
symbol='++', edge_color=self.app.cursor_color_3D,
edge_width=self.app.defaults["global_cursor_width"],
size=self.app.defaults["global_cursor_size"])
# update the positions on status bar
self.app.ui.position_label.setText("&nbsp;&nbsp;&nbsp;&nbsp;<b>X</b>: %.4f&nbsp;&nbsp; "
"<b>Y</b>: %.4f" % (curr_pos[0], curr_pos[1]))
if self.cursor_pos is None:
self.cursor_pos = (0, 0)
self.app.dx = curr_pos[0] - float(self.cursor_pos[0])
self.app.dy = curr_pos[1] - float(self.cursor_pos[1])
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
# draw the utility geometry
if shape_type == "square":
if self.first_click:
self.app.delete_selection_shape()
self.app.draw_moving_selection_shape(old_coords=(self.cursor_pos[0], self.cursor_pos[1]),
coords=(curr_pos[0], curr_pos[1]))
else:
FlatCAMTool.FlatCAMTool.delete_moving_selection_shape(self)
FlatCAMTool.FlatCAMTool.draw_moving_selection_shape_poly(
self, points=self.points, data=(curr_pos[0], curr_pos[1]))
def on_clear_area_click(self):
self.exclusion_areas_list = []
FlatCAMTool.FlatCAMTool.delete_moving_selection_shape(self)
self.app.delete_selection_shape()
@staticmethod
def merge(geo_list, geo_final, multigeo=None):
"""

View File

@ -73,6 +73,10 @@ class HPGL2:
"toolchangez": self.app.defaults["geometry_toolchangez"],
"endz": self.app.defaults["geometry_endz"],
"endxy": self.app.defaults["geometry_endxy"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": self.app.defaults["geometry_area_overz"],
"spindlespeed": self.app.defaults["geometry_spindlespeed"],
"toolchangexy": self.app.defaults["geometry_toolchangexy"],

View File

@ -479,6 +479,10 @@ class CutOut(FlatCAMTool):
"toolchangez": float(self.app.defaults["geometry_toolchangez"]),
"startz": self.app.defaults["geometry_startz"],
"endz": float(self.app.defaults["geometry_endz"]),
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": float(self.app.defaults["geometry_area_overz"]),
# NCC
"tools_nccoperation": self.app.defaults["tools_nccoperation"],

View File

@ -1039,6 +1039,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
"toolchangexy": self.app.defaults["geometry_toolchangexy"],
"startz": self.app.defaults["geometry_startz"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": float(self.app.defaults["geometry_area_overz"]),
"tools_nccoperation": self.app.defaults["tools_nccoperation"],
"tools_nccmargin": self.app.defaults["tools_nccmargin"],
"tools_nccmethod": self.app.defaults["tools_nccmethod"],

View File

@ -1013,6 +1013,11 @@ class ToolPaint(FlatCAMTool, Gerber):
"toolchangexy": self.app.defaults["geometry_toolchangexy"],
"startz": self.app.defaults["geometry_startz"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": float(self.app.defaults["geometry_area_overz"]),
"tooldia": self.app.defaults["tools_painttooldia"],
"tools_paintmargin": self.app.defaults["tools_paintmargin"],
"tools_paintmethod": self.app.defaults["tools_paintmethod"],

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-05-02 23:49+0300\n"
"PO-Revision-Date: 2020-05-02 23:50+0300\n"
"PO-Revision-Date: 2020-05-03 12:06+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: it\n"
@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Basepath: ../../..\n"
"X-Poedit-SearchPath-0: .\n"
@ -3584,7 +3584,7 @@ msgstr "Utensile testo"
#: flatcamTools/ToolNCC.py:331 flatcamTools/ToolNCC.py:797
#: flatcamTools/ToolPaint.py:314 flatcamTools/ToolPaint.py:767
msgid "Tool"
msgstr "Utensile"
msgstr "Strumenti"
#: flatcamEditors/FlatCAMGeoEditor.py:439 flatcamGUI/ObjectUI.py:364
#: flatcamGUI/preferences/gerber/GerberOptPrefGroupUI.py:43
@ -6064,7 +6064,7 @@ msgstr "Strumento QRCode"
#: flatcamGUI/FlatCAMGUI.py:949 flatcamGUI/FlatCAMGUI.py:2653
#: flatcamTools/ToolCopperThieving.py:39 flatcamTools/ToolCopperThieving.py:568
msgid "Copper Thieving Tool"
msgstr "Strumento rimozione rame"
msgstr "Strumento deposito rame"
#: flatcamGUI/FlatCAMGUI.py:952 flatcamGUI/FlatCAMGUI.py:1741
#: flatcamGUI/FlatCAMGUI.py:2656 flatcamTools/ToolFiducials.py:33
@ -11136,14 +11136,14 @@ msgstr "Combina Passi"
#: flatcamGUI/preferences/tools/Tools2CThievingPrefGroupUI.py:27
msgid "Copper Thieving Tool Options"
msgstr "Opzioni dello strumento rimozione rame"
msgstr "Opzioni dello strumento deposito rame"
#: flatcamGUI/preferences/tools/Tools2CThievingPrefGroupUI.py:39
msgid ""
"A tool to generate a Copper Thieving that can be added\n"
"to a selected Gerber file."
msgstr ""
"Uno strumento per generare una rimozione di rame che può essere aggiunto\n"
"Uno strumento per generare un deposito di rame che può essere aggiunto\n"
"in un file Gerber selezionato."
#: flatcamGUI/preferences/tools/Tools2CThievingPrefGroupUI.py:47
@ -11162,7 +11162,7 @@ msgid ""
"(the polygon fill may be split in multiple polygons)\n"
"and the copper traces in the Gerber file."
msgstr ""
"Imposta la distanza tra componenti di rame\n"
"Imposta la distanza tra componenti del deposito di rame\n"
"(i poligoni possono essere divisi in sottopoligoni)\n"
"e le tracce di rame nel file Gerber."
@ -11203,8 +11203,8 @@ msgid ""
"- 'Reference Object' - will do copper thieving within the area specified by "
"another object."
msgstr ""
"- 'Stesso': l'estensione delle aree di rame si basa sull'estensione "
"dell'oggetto.\n"
"- 'Stesso': l'estensione delle aree di deposito di rame si basa "
"sull'estensione dell'oggetto.\n"
"- 'Selezione area': fare clic con il pulsante sinistro del mouse per avviare "
"la selezione dell'area da riempire.\n"
"- 'Oggetto di riferimento': eseguirà il deposito di rame nell'area "
@ -11268,7 +11268,7 @@ msgid ""
"- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n"
"- 'Lines Grid' - the empty area will be filled with a pattern of lines."
msgstr ""
"- 'Solido': il rame sarà un poligono solido.\n"
"- 'Solido': il deposito di rame sarà un poligono solido.\n"
"- 'Dots Grid': l'area vuota verrà riempita con uno schema di punti.\n"
"- 'Squares Grid': l'area vuota verrà riempita con uno schema di quadrati.\n"
"- 'Griglia di linee': l'area vuota verrà riempita con un motivo di linee."
@ -11372,7 +11372,7 @@ msgid ""
"The distance between the possible copper thieving elements\n"
"and/or robber bar and the actual openings in the mask."
msgstr ""
"La distanza tra i possibili elementi di rame\n"
"La distanza tra i possibili elementi del deposito di rame\n"
"e/o barra del \"rapinatore\" e le aperture effettive nella maschera."
#: flatcamGUI/preferences/tools/Tools2CalPrefGroupUI.py:27
@ -14737,7 +14737,7 @@ msgid ""
"(the polygon fill may be split in multiple polygons)\n"
"and the copper traces in the Gerber file."
msgstr ""
"Questo imposta la distanza tra i componenti del ladro di rame\n"
"Questo imposta la distanza tra i componenti del deposito di rame\n"
"(il riempimento poligonale può essere suddiviso in più poligoni)\n"
"e le tracce di rame nel file Gerber."
@ -14749,7 +14749,7 @@ msgid ""
"- 'Reference Object' - will do copper thieving within the area specified by "
"another object."
msgstr ""
"- 'Stesso': l'estensione del furto di rame si basa sull'estensione "
"- 'Stesso': l'estensione del deposito di rame si basa sull'estensione "
"dell'oggetto.\n"
"- 'Selezione area': fare clic con il pulsante sinistro del mouse per avviare "
"la selezione dell'area da riempire.\n"
@ -14766,7 +14766,8 @@ msgid ""
"The type of FlatCAM object to be used as copper thieving reference.\n"
"It can be Gerber, Excellon or Geometry."
msgstr ""
"Il tipo di oggetto FlatCAM da utilizzare come riferimento ladro di rame.\n"
"Il tipo di oggetto FlatCAM da utilizzare come deposito di rame di "
"riferimento.\n"
"Può essere Gerber, Excellon o Geometry."
#: flatcamTools/ToolCopperThieving.py:149 flatcamTools/ToolNCC.py:562
@ -14781,7 +14782,7 @@ msgstr "Oggetto FlatCAM da usare come riferimento rimozione rame."
#: flatcamTools/ToolCopperThieving.py:327
msgid "Insert Copper thieving"
msgstr "Inserire il ladro di rame"
msgstr "Inserire il deposito di rame"
#: flatcamTools/ToolCopperThieving.py:329
msgid ""
@ -14862,7 +14863,7 @@ msgid ""
"the robber bar if those were generated."
msgstr ""
"Aggiungerà alla geometria gerber soldermask\n"
"le geometrie del ladro di rame e/o\n"
"le geometrie del deposito di rame e/o\n"
"la barra dei ladri se sono stati generati."
#: flatcamTools/ToolCopperThieving.py:625
@ -14905,7 +14906,7 @@ msgstr "Aggiungi file sorgente"
#: flatcamTools/ToolCopperThieving.py:732
#: flatcamTools/ToolCopperThieving.py:1314
msgid "Copper Thieving Tool done."
msgstr "Strumento ladro di rame fatto."
msgstr "Strumento deposito di rame fatto."
#: flatcamTools/ToolCopperThieving.py:759
#: flatcamTools/ToolCopperThieving.py:792 flatcamTools/ToolCutOut.py:515
@ -14939,21 +14940,21 @@ msgstr ""
#: flatcamTools/ToolCopperThieving.py:946
#: flatcamTools/ToolCopperThieving.py:1007
msgid "Thieving"
msgstr "Ladro"
msgstr "Deposito"
#: flatcamTools/ToolCopperThieving.py:953
msgid "Copper Thieving Tool started. Reading parameters."
msgstr "Strumento ladro di rame avviato. Lettura dei parametri."
msgstr "Strumento deposito di rame avviato. Lettura dei parametri."
#: flatcamTools/ToolCopperThieving.py:978
msgid "Copper Thieving Tool. Preparing isolation polygons."
msgstr ""
"Strumento di ladro di rame avviato. Preparazione poligoni di isolamento."
"Strumento deposito di rame avviato. Preparazione poligoni di isolamento."
#: flatcamTools/ToolCopperThieving.py:1023
msgid "Copper Thieving Tool. Preparing areas to fill with copper."
msgstr ""
"Strumento di ladro di rame avviato. Preparazione aree da riempire di rame."
"Strumento deposito di rame avviato. Preparazione aree da riempire di rame."
#: flatcamTools/ToolCopperThieving.py:1034 flatcamTools/ToolOptimal.py:349
#: flatcamTools/ToolPanelize.py:799 flatcamTools/ToolRulesCheck.py:1127
@ -14977,7 +14978,7 @@ msgstr "Il tipo di oggetto di riferimento non è supportato."
#: flatcamTools/ToolCopperThieving.py:1109
msgid "Copper Thieving Tool. Appending new geometry and buffering."
msgstr "Strumento di ladro di rame. Aggiunta di nuova geometria e buffering."
msgstr "Strumento deposito di rame. Aggiunta di nuova geometria e buffering."
#: flatcamTools/ToolCopperThieving.py:1125
msgid "Create geometry"
@ -14998,7 +14999,7 @@ msgstr "Generazione maschera Placatura eseguita."
#: flatcamTools/ToolCopperThieving.py:1549
msgid "Copper Thieving Tool exit."
msgstr "Chiudi strumento ladro di rame."
msgstr "Chiudi strumento deposito di rame."
#: flatcamTools/ToolCutOut.py:41
msgid "Cutout PCB"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ include_files.append(("config", "lib/config"))
include_files.append(("README.md", "README.md"))
include_files.append(("LICENSE", "LICENSE"))
include_files.append(("CHANGELOG.md", "CHANGELOG.md"))
base = None
# Lets not open the console while running the app

View File

@ -218,6 +218,11 @@ class TclCommandCopperClear(TclCommand):
"toolchangexy": self.app.defaults["geometry_toolchangexy"],
"startz": self.app.defaults["geometry_startz"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": float(self.app.defaults["geometry_area_overz"]),
"tooldia": self.app.defaults["tools_painttooldia"],
"tools_nccmargin": margin,
"tools_nccmethod": method_data,

View File

@ -44,7 +44,7 @@ class TclCommandIsolate(TclCommandSignaled):
help = {
'main': "Creates isolation routing Geometry for the specified Gerber object.",
'args': collections.OrderedDict([
('name', 'Name of the source object. Required.'),
('name', 'Name of the Gerber source object to be isolated. Required.'),
('dia', 'Tool diameter.'),
('passes', 'Passes of tool width.'),
('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n'
@ -55,7 +55,7 @@ class TclCommandIsolate(TclCommandSignaled):
('iso_type', 'A value of 0 will isolate exteriors, a value of 1 will isolate interiors '
'and a value of 2 will do full isolation.')
]),
'examples': ['isolate my_geo -dia 0.1 -passes 2 -overlap 10 -combine True -iso_type 2 -outname out_geo']
'examples': ['isolate my_gerber -dia 0.1 -passes 2 -overlap 10 -combine True -iso_type 2 -outname out_geo']
}
def execute(self, args, unnamed_args):

View File

@ -52,7 +52,8 @@ class TclCommandOpenGCode(TclCommandSignaled):
"""
args['plot'] = False
args['from_tcl'] = True
filename = args["filename"]
filename = args.pop("filename")
# if ' ' in filename:
# return "The absolute path to the project file contain spaces which is not allowed.\n" \
# "Please enclose the path within quotes."

View File

@ -56,7 +56,7 @@ class TclCommandOpenGerber(TclCommandSignaled):
filename = args.pop('filename')
if 'outname' in args:
outname = args['outname']
outname = args.pop('outname')
else:
outname = filename.split('/')[-1].split('\\')[-1]

View File

@ -197,6 +197,11 @@ class TclCommandPaint(TclCommand):
"toolchangexy": self.app.defaults["geometry_toolchangexy"],
"startz": self.app.defaults["geometry_startz"],
"area_exclusion": self.app.defaults["geometry_area_exclusion"],
"area_shape": self.app.defaults["geometry_area_shape"],
"area_strategy": self.app.defaults["geometry_area_strategy"],
"area_overz": float(self.app.defaults["geometry_area_overz"]),
"tooldia": self.app.defaults["tools_painttooldia"],
"paintmargin": margin,
"paintmethod": method,