From c5b34d654e23635e15e75e8a4ea08df1e9fc23f4 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Wed, 28 Aug 2019 21:00:13 +0100 Subject: [PATCH 1/2] Add tool height offsets to Linuxcnc_post --- src/Mod/Path/PathScripts/post/linuxcnc_post.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index 450048c748..792826e1bc 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -354,6 +354,10 @@ def parse(pathobj): for line in TOOL_CHANGE.splitlines(True): out += linenumber() + line + # add height offset + tool_height = '\nG43 H' + str(int(c.Parameters['T'])) + outstring.append(tool_height) + if command == "message": if OUTPUT_COMMENTS is False: out = [] From 23083136ee54d75f8774cb10e1d977889974ed06 Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Fri, 6 Sep 2019 12:29:13 +0100 Subject: [PATCH 2/2] Add option to supress the tool length offset --- src/Mod/Path/PathScripts/post/linuxcnc_post.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index 792826e1bc..3d411a0cef 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -54,6 +54,7 @@ parser.add_argument('--postamble', help='set commands to be issued after the las parser.add_argument('--inches', action='store_true', help='Convert output for US imperial mode (G20)') parser.add_argument('--modal', action='store_true', help='Output the Same G-command Name USE NonModal Mode') parser.add_argument('--axis-modal', action='store_true', help='Output the Same Axis Value Mode') +parser.add_argument('--no-tlo', action='store_true', help='supress tool length offset (G43) following tool changes') TOOLTIP_ARGS = parser.format_help() @@ -63,6 +64,7 @@ OUTPUT_HEADER = True OUTPUT_LINE_NUMBERS = False SHOW_EDITOR = True MODAL = False # if true commands are suppressed if the same as previous line. +USE_TLO = True # if true G43 will be output following tool changes OUTPUT_DOUBLES = True # if false duplicate axis values are suppressed if the same as previous line. COMMAND_SPACE = " " LINENR = 100 # line number starting value @@ -114,6 +116,7 @@ def processArguments(argstring): global UNIT_SPEED_FORMAT global UNIT_FORMAT global MODAL + global USE_TLO global OUTPUT_DOUBLES try: @@ -139,6 +142,8 @@ def processArguments(argstring): PRECISION = 4 if args.modal: MODAL = True + if args.no_tlo: + USE_TLO = False if args.axis_modal: print ('here') OUTPUT_DOUBLES = False @@ -355,8 +360,9 @@ def parse(pathobj): out += linenumber() + line # add height offset - tool_height = '\nG43 H' + str(int(c.Parameters['T'])) - outstring.append(tool_height) + if USE_TLO: + tool_height = '\nG43 H' + str(int(c.Parameters['T'])) + outstring.append(tool_height) if command == "message": if OUTPUT_COMMENTS is False: