浏览代码

- optimized the storage of the Gerber mark shapes by making them one layer only
- optimized the Distance Tool such that the distance utility geometry will be shown even when the mark shapes are plotted.

Marius Stanciu 6 年之前
父节点
当前提交
d327160ab9
共有 3 个文件被更改,包括 15 次插入4 次删除
  1. 4 4
      FlatCAMObj.py
  2. 5 0
      README.md
  3. 6 0
      flatcamTools/ToolDistance.py

+ 4 - 4
FlatCAMObj.py

@@ -409,7 +409,7 @@ class FlatCAMObj(QtCore.QObject):
         if self.deleted:
             raise ObjectDeleted()
         else:
-            key = self.mark_shapes[apid].add(tolerance=self.drawing_tolerance, **kwargs)
+            key = self.mark_shapes[apid].add(tolerance=self.drawing_tolerance, layer=0, **kwargs)
         return key
 
     def update_filters(self, last_ext, filter_string):
@@ -1413,7 +1413,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
             # add the shapes storage for marking apertures
             if self.app.is_legacy is False:
                 for ap_code in self.apertures:
-                    self.mark_shapes[ap_code] = self.app.plotcanvas.new_shape_collection(layers=2)
+                    self.mark_shapes[ap_code] = self.app.plotcanvas.new_shape_collection(layers=1)
             else:
                 for ap_code in self.apertures:
                     self.mark_shapes[ap_code] = ShapeCollectionLegacy(obj=self, app=self.app,
@@ -1675,7 +1675,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
         if self.ui.apertures_table.cellWidget(cw_row, 5).isChecked():
             self.marked_rows.append(True)
             # self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
-            self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'FF',
+            self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'AF',
                                marked_aperture=aperture, visible=True, run_thread=True)
             # self.mark_shapes[aperture].redraw()
         else:
@@ -1713,7 +1713,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
         if mark_all:
             for aperture in self.apertures:
                 # self.plot_aperture(color='#2d4606bf', marked_aperture=aperture, visible=True)
-                self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'FF',
+                self.plot_aperture(color=self.app.defaults['global_sel_draw_color'] + 'AF',
                                    marked_aperture=aperture, visible=True)
             # HACK: enable/disable the grid for a better look
             self.app.ui.grid_snap_btn.trigger()

+ 5 - 0
README.md

@@ -9,6 +9,11 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+17.11.2019
+
+- optimized the storage of the Gerber mark shapes by making them one layer only
+- optimized the Distance Tool such that the distance utility geometry will be shown even when the mark shapes are plotted.
+
 16.11.2019
 
 - fixed issue #341 that affected both postprocessors that have inlined feedrate: marlin and repetier. THe used feedrate was the Feedrate X-Y and instead had to be Feedrate Z.

+ 6 - 0
flatcamTools/ToolDistance.py

@@ -194,6 +194,12 @@ class Distance(FlatCAMTool):
         self.distance_y_entry.set_value('0.0')
         self.angle_entry.set_value('0.0')
         self.total_distance_entry.set_value('0.0')
+
+        # this is a hack; seems that triggering the grid will make the visuals better
+        # trigger it twice to return to the original state
+        self.app.ui.grid_snap_btn.trigger()
+        self.app.ui.grid_snap_btn.trigger()
+
         log.debug("Distance Tool --> tool initialized")
 
     def activate_measure_tool(self):