Merge pull request #2337 from Russ4262/helix_sort
[Path] PathHelix: Add simple x,y path sorting
This commit is contained in:
@@ -51,7 +51,7 @@ __doc__ = "Base class an implementation for operations on circular holes."
|
||||
__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
|
||||
@@ -323,7 +323,7 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -31,6 +31,7 @@ import PathScripts.PathOp as PathOp
|
||||
|
||||
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"
|
||||
@@ -39,8 +40,8 @@ __url__ = "http://www.freecadweb.org"
|
||||
__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):
|
||||
@@ -81,6 +82,7 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user