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

This commit is contained in:
jpcaram 2015-02-07 18:41:29 -05:00
parent 6e8f82c487
commit 41e63c4390
3 changed files with 21 additions and 2 deletions

View File

@ -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()")

View File

@ -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."

View File

@ -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