Parcourir la source

Added paint_connect to standard paint algorithm. Resolves issue #103.

jpcaram il y a 11 ans
Parent
commit
41e63c4390
3 fichiers modifiés avec 21 ajouts et 2 suppressions
  1. 8 0
      FlatCAMObj.py
  2. 0 1
      ObjectUI.py
  3. 13 1
      camlib.py

+ 8 - 0
FlatCAMObj.py

@@ -602,6 +602,14 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         self.ui.tools_table.setSortingEnabled(True)
 
     def set_ui(self, ui):
+        """
+        Configures the user interface for this object.
+        Connects options to form fields.
+
+        :param ui: User interface object.
+        :type ui: ExcellonObjectUI
+        :return: None
+        """
         FlatCAMObj.set_ui(self, ui)
 
         FlatCAMApp.App.log.debug("FlatCAMExcellon.set_ui()")

+ 0 - 1
ObjectUI.py

@@ -435,7 +435,6 @@ class ExcellonObjectUI(ObjectUI):
         grid1.addWidget(self.toolchangez_entry, 4, 1)
         self.ois_tcz = OptionalInputSection(self.toolchange_cb, [self.toolchangez_entry])
 
-
         choose_tools_label = QtGui.QLabel(
             "Select from the tools section above\n"
             "the tools you want to include."

+ 13 - 1
camlib.py

@@ -376,6 +376,11 @@ class Geometry(object):
                         geoms.insert(i)
             else:
                 break
+
+        # Optimization: Reduce lifts
+        log.debug("Reducing tool lifts...")
+        geoms = Geometry.paint_connect(geoms, polygon, tooldia)
+
         return geoms
 
     @staticmethod
@@ -481,7 +486,14 @@ class Geometry(object):
         Connects paths that results in a connection segment that is
         within the paint area. This avoids unnecessary tool lifting.
 
-        :return:
+        :param storage: Geometry to be optimized.
+        :type storage: FlatCAMRTreeStorage
+        :param boundary: Polygon defining the limits of the paintable area.
+        :type boundary: Polygon
+        :param max_walk: Maximum allowable distance without lifting tool.
+        :type max_walk: float or None
+        :return: Optimized geometry.
+        :rtype: FlatCAMRTreeStorage
         """
 
         # If max_walk is not specified, the maximum allowed is