diff --git a/FlatCAMDraw.py b/FlatCAMDraw.py index 60eb99b..fb5d2b9 100644 --- a/FlatCAMDraw.py +++ b/FlatCAMDraw.py @@ -526,7 +526,7 @@ class FlatCAMDraw(QtCore.QObject): self.drawing_toolbar = QtGui.QToolBar() self.drawing_toolbar.setDisabled(disabled) self.app.ui.addToolBar(self.drawing_toolbar) - self.select_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), 'Select') + self.select_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select 'Esc'") self.add_circle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/circle32.png'), 'Add Circle') self.add_arc_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/arc32.png'), 'Add Arc') self.add_rectangle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/rectangle32.png'), 'Add Rectangle') @@ -535,8 +535,9 @@ class FlatCAMDraw(QtCore.QObject): self.union_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/union32.png'), 'Polygon Union') self.subtract_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/subtract32.png'), 'Polygon Subtraction') self.cutpath_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/cutpath32.png'), 'Cut Path') - self.move_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/move32.png'), 'Move Objects') - self.copy_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/copy32.png'), 'Copy Objects') + self.move_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Objects 'm'") + self.copy_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/copy32.png'), "Copy Objects 'c'") + self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'), "Delete Shape '-'") ### Snap Toolbar ### self.snap_toolbar = QtGui.QToolBar() @@ -569,6 +570,7 @@ class FlatCAMDraw(QtCore.QObject): self.union_btn.triggered.connect(self.union) self.subtract_btn.triggered.connect(self.subtract) self.cutpath_btn.triggered.connect(self.cutpath) + self.delete_btn.triggered.connect(self.on_delete_btn) ## Toolbar events and properties self.tools = { @@ -926,6 +928,10 @@ class FlatCAMDraw(QtCore.QObject): def on_canvas_key_release(self, event): self.key = None + def on_delete_btn(self): + self.delete_selected() + self.replot() + def get_selected(self): """ Returns list of shapes that are selected in the editor. diff --git a/camlib.py b/camlib.py index 416ff51..8e5319b 100644 --- a/camlib.py +++ b/camlib.py @@ -2370,19 +2370,14 @@ class CNCjob(Geometry): try: while True: path_count += 1 - print "Current: ", "(%.3f, %.3f)" % current_pt - - # TODO: There shoudn't be any None in geometry.flatten() - # if geo is None: - # storage.remove(geo) - # continue + #print "Current: ", "(%.3f, %.3f)" % current_pt # Remove before modifying, otherwise # deletion will fail. storage.remove(geo) if list(pt) == list(geo.coords[-1]): - print "Reversing" + #print "Reversing" geo.coords = list(geo.coords)[::-1] # G-code diff --git a/doc/source/planning.rst b/doc/source/planning.rst index 4d9ea45..6dd24bc 100644 --- a/doc/source/planning.rst +++ b/doc/source/planning.rst @@ -15,12 +15,14 @@ Drawing * [DONE] Remove from index (rebuild index or make deleted instances equal to None in the list). * Better handling/abstraction of geometry types and lists of such. + * Plotting and extraction of point is now done in a quite + efficient recursive way. Algorithms ---------- -* Reverse path if end is nearer. +* [DONE] Reverse path if end is nearer. * Seed paint: Specify seed. @@ -48,4 +50,11 @@ Bugs ---- * Unit conversion on opening. -* `cascaded_union([])` bug requires more testing. \ No newline at end of file +* [DONE] `cascaded_union([])` bug requires more testing. + * Old version of GEOS + + +Other +----- + +* Unit testing \ No newline at end of file diff --git a/share/deleteshape16.png b/share/deleteshape16.png new file mode 100644 index 0000000..cb672fa Binary files /dev/null and b/share/deleteshape16.png differ diff --git a/share/deleteshape24.png b/share/deleteshape24.png new file mode 100644 index 0000000..8b2cdda Binary files /dev/null and b/share/deleteshape24.png differ diff --git a/share/deleteshape32.png b/share/deleteshape32.png new file mode 100644 index 0000000..822c423 Binary files /dev/null and b/share/deleteshape32.png differ