diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index 483560e865..026a8e487f 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -327,21 +327,21 @@ class ObjectOp(PathOp.ObjectOp): shapes.append(shp) if len(shapes) > 1: - jobs = list() + locations = [] for s in shapes: if s[2] == 'OpenEdge': shp = Part.makeCompound(s[0]) else: shp = s[0] - jobs.append({ + locations.append({ 'x': shp.BoundBox.XMax, 'y': shp.BoundBox.YMax, 'shape': s }) - jobs = PathUtils.sort_jobs(jobs, ['x', 'y']) + locations = PathUtils.sort_locations(locations, ['x', 'y']) - shapes = [j['shape'] for j in jobs] + shapes = [j['shape'] for j in locations] sims = [] for shape, isHole, sub in shapes: diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index 0d9c40a9f6..4f845a145b 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -160,7 +160,7 @@ class ObjectDrilling(PathCircularHoleBase.ObjectOp): # http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g98-g99 self.commandlist.append(Path.Command(obj.ReturnLevel)) - holes = PathUtils.sort_jobs(holes, ["x", "y"]) + holes = PathUtils.sort_locations(holes, ["x", "y"]) # This section is technical debt. The computation of the # target shapes should be factored out for re-use. diff --git a/src/Mod/Path/PathScripts/PathHelix.py b/src/Mod/Path/PathScripts/PathHelix.py index a19910ed8c..cdf3a24faf 100644 --- a/src/Mod/Path/PathScripts/PathHelix.py +++ b/src/Mod/Path/PathScripts/PathHelix.py @@ -29,7 +29,7 @@ import PathScripts.PathOp as PathOp from PathScripts.PathUtils import fmt from PathScripts.PathUtils import findParentJob -from PathScripts.PathUtils import sort_jobs +from PathScripts.PathUtils import sort_locations from PySide import QtCore __title__ = "Path Helix Drill Operation" @@ -79,7 +79,7 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp): output = '' output += "G0 Z" + fmt(zsafe) - holes = sort_jobs(holes, ['x', 'y']) + holes = sort_locations(holes, ['x', 'y']) for hole in holes: output += self.helix_cut(obj, hole['x'], hole['y'], hole['r'] / 2, float(obj.StartRadius.Value), (float(obj.StepOver.Value) / 50.0) * self.radius) PathLog.debug(output) diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 2cb2adf3bb..cd2448a5ab 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -639,7 +639,7 @@ def rampPlunge(edge, rampangle, destZ, startZ): return rampCmds -def sort_jobs(locations, keys, attractors=None): +def sort_locations(locations, keys, attractors=None): """sort holes by the nearest neighbor method keys: two-element list of keys for X and Y coordinates. for example ['x','y'] originally written by m0n5t3r for PathHelix