Skip to content

Commit

Permalink
PathHelix: Add simple x,y path sorting
Browse files Browse the repository at this point in the history
Same PathUtils.sort_jobs() method copied from PathDrilling
Change feedback comment to debug category
  • Loading branch information
Russ4262 committed Jul 12, 2019
1 parent ec00499 commit ea5a139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Path/PathScripts/PathCircularHoleBase.py
Expand Up @@ -51,7 +51,7 @@
__contributors__ = "russ4262 (Russell Johnson)"
__created__ = "2017"
__scriptVersion__ = "1d testing"
__lastModified__ = "2019-07-09 22:59 CST"
__lastModified__ = "2019-07-12 09:58 CST"


# Qt translation handling
Expand Down Expand Up @@ -323,7 +323,7 @@ def haveLocations(self, obj):

# If user has not adjusted Final Depth value, attempt to determine from sub
if obj.OpFinalDepth.Value == obj.FinalDepth.Value:
PathLog.info(translate('Path', 'Auto detecting Final Depth based on {}.'.format(sub)))
PathLog.debug(translate('Path', 'Auto detecting Final Depth based on {}.'.format(sub)))
trgtDep = finDep
else:
trgtDep = max(obj.FinalDepth.Value, finDep)
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Path/PathScripts/PathHelix.py
Expand Up @@ -31,6 +31,7 @@

from PathScripts.PathUtils import fmt
from PathScripts.PathUtils import findParentJob
from PathScripts.PathUtils import sort_jobs
from PySide import QtCore

__title__ = "Path Helix Drill Operation"
Expand All @@ -39,8 +40,8 @@
__doc__ = "Class and implementation of Helix Drill operation"
__contributors__ = "russ4262 (Russell Johnson)"
__created__ = "2016"
__scriptVersion__ = "1a testing"
__lastModified__ = "2019-07-03 11:45 CST"
__scriptVersion__ = "1b testing"
__lastModified__ = "2019-07-12 09:50 CST"


def translate(context, text, disambig=None):
Expand Down Expand Up @@ -81,6 +82,7 @@ def circularHoleExecute(self, obj, holes):
output = ''
output += "G0 Z" + fmt(zsafe)

holes = sort_jobs(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)
Expand Down

0 comments on commit ea5a139

Please sign in to comment.