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

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