Parcourir la source

- working to update the Paint Tool

Marius Stanciu il y a 5 ans
Parent
commit
8a2f5fed05
4 fichiers modifiés avec 419 ajouts et 361 suppressions
  1. 4 0
      README.md
  2. 14 4
      camlib.py
  3. 11 3
      flatcamTools/ToolNCC.py
  4. 390 354
      flatcamTools/ToolPaint.py

+ 4 - 0
README.md

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+30.03.2020
+
+- working to update the Paint Tool
+
 29.03.2020
 
 - modified the new database to accept data from NCC and Paint Tools

+ 14 - 4
camlib.py

@@ -1470,8 +1470,13 @@ class Geometry(object):
                 line = LineString([(left, y), (right, y)])
                 line = line.intersection(margin_poly)
 
-                for ll in line:
-                    lines_trimmed.append(ll)
+                try:
+                    for ll in line:
+                        lines_trimmed.append(ll)
+                        if prog_plot:
+                            self.plot_temp_shapes(ll)
+                except TypeError:
+                    lines_trimmed.append(line)
                     if prog_plot:
                         self.plot_temp_shapes(line)
             except Exception as e:
@@ -1502,8 +1507,13 @@ class Geometry(object):
                 line = LineString([(x, top), (x, bot)])
                 line = line.intersection(margin_poly)
 
-                for ll in line:
-                    lines_trimmed.append(ll)
+                try:
+                    for ll in line:
+                        lines_trimmed.append(ll)
+                        if prog_plot:
+                            self.plot_temp_shapes(ll)
+                except TypeError:
+                    lines_trimmed.append(line)
                     if prog_plot:
                         self.plot_temp_shapes(line)
             except Exception as e:

+ 11 - 3
flatcamTools/ToolNCC.py

@@ -128,6 +128,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
         self.tools_box.addWidget(self.tools_table)
 
         self.tools_table.setColumnCount(4)
+        # 3rd column is reserved (and hidden) for the tool ID
         self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), _('TT'), ''])
         self.tools_table.setColumnHidden(3, True)
         self.tools_table.setSortingEnabled(False)
@@ -3971,6 +3972,13 @@ class NonCopperClear(FlatCAMTool, Gerber):
             return
         self.app.inform.emit('[success] %s' % _("Tool from DB added in Tool Table."))
 
+        # select last tool added
+        toolid = res
+        for row in range(self.tools_table.rowCount()):
+            if int(self.tools_table.item(row, 3).text()) == toolid:
+                self.tools_table.selectRow(row)
+        self.on_row_selection_change()
+
     def on_ncc_tool_from_db_inserted(self, tool):
         """
         Called from the Tools DB object through a App method when adding a tool from Tools Database
@@ -4012,9 +4020,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
         self.ncc_tools.update({
             tooluid: {
                 'tooldia': float('%.*f' % (self.decimals, tooldia)),
-                'offset': 'Path',
-                'offset_value': 0.0,
-                'type': 'Iso',
+                'offset': tool['offset'],
+                'offset_value': tool['offset_value'],
+                'type': tool['type'],
                 'tool_type': tool['tool_type'],
                 'data': deepcopy(tool['data']),
                 'solid_geometry': []

Fichier diff supprimé car celui-ci est trop grand
+ 390 - 354
flatcamTools/ToolPaint.py


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff