gcode_arcs: use z-height defined in f2/3 code, if present

Signed-off-by: Aleksej Vasiljkovic <achmed21@gmail.com>
This commit is contained in:
achmed20 2019-09-18 17:57:16 +02:00 committed by KevinOConnor
parent 8c69e1bcfe
commit fce98c5519
1 changed files with 3 additions and 4 deletions

View File

@ -19,8 +19,7 @@ import re
class ArcSupport: class ArcSupport:
def __init__(self, config): def __init__(self, config):
self.printer = config.get_printer() self.printer = config.get_printer()
self.mm_per_arc_segment = config.getfloat('resolution', 1) self.mm_per_arc_segment = config.getfloat('resolution', 1, above=0.0)
self.debug = True #will respond motion to terminal as G1 code
self.gcode = self.printer.lookup_object('gcode') self.gcode = self.printer.lookup_object('gcode')
self.gcode.register_command("G2", self.cmd_G2, desc=self.cmd_G2_help) self.gcode.register_command("G2", self.cmd_G2, desc=self.cmd_G2_help)
@ -81,8 +80,8 @@ class ArcSupport:
# build dict and call cmd_G1 # build dict and call cmd_G1
for coord in coords: for coord in coords:
g1_params = {'X': coord[0], 'Y': coord[1]} g1_params = {'X': coord[0], 'Y': coord[1]}
if asZ: if asZ!=None:
g1_params['Z']= float(asZ)/len(coords) g1_params['Z']= float(asZ)
if asE>0: if asE>0:
g1_params['E']= float(asE)/len(coords) g1_params['E']= float(asE)/len(coords)
if asF>0: if asF>0: