Commit bf1bcd27 authored by sumpfralle's avatar sumpfralle

simplified the "minimum_step" parameters for the GCode generator (fall back to...

simplified the "minimum_step" parameters for the GCode generator (fall back to x, if y/z are not given)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@953 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 78aaf83b
......@@ -378,9 +378,7 @@ def execute(parser, opts, args, pycam):
handler, metric_units = (opts.unit_size == "mm"),
safety_height=opts.safety_height,
toggle_spindle_status=opts.gcode_no_start_stop_spindle,
minimum_step_x=opts.gcode_minimum_step_x,
minimum_step_y=opts.gcode_minimum_step_y,
minimum_step_z=opts.gcode_minimum_step_z)
minimum_step_x=opts.gcode_minimum_step)
generator.set_speed(opts.tool_feedrate, opts.tool_spindle_speed)
path_mode = opts.gcode_path_mode
PATH_MODES = pycam.Exporters.GCodeExporter.PATH_MODES
......@@ -618,10 +616,10 @@ if __name__ == "__main__":
action="store_false", help="do not start the spindle before " \
+ "and stop it after each operation (M3/M5)")
group_gcode.add_option("", "--gcode-minimum-step",
dest="gcode_minimum_step_x", default=0.0,
dest="gcode_minimum_step", default=0.00001,
type="float", action="store", help="mimimum axial distance " \
+ "between two machine positions. Any shorter move is not " \
+ "written to GCode (default: 0.0).")
+ "written to GCode (default: 0.00001).")
group_gcode.add_option("", "--gcode-path-mode", dest="gcode_path_mode",
default="exact_path", action="store", type="choice",
choices=["exact_path", "exact_stop", "continuous"],
......
......@@ -38,7 +38,7 @@ class GCodeGenerator:
def __init__(self, destination, metric_units=True, safety_height=0.0,
toggle_spindle_status=False, header=None, comment=None,
minimum_step_x=0.0001, minimum_step_y=0.0001, minimum_step_z=0.0001):
minimum_step_x=0.0001, minimum_step_y=None, minimum_step_z=None):
if isinstance(destination, basestring):
# open the file
self.destination = file(destination,"w")
......@@ -54,7 +54,14 @@ class GCodeGenerator:
self.toggle_spindle_status = toggle_spindle_status
self.comment = comment
self._minimum_step_x = minimum_step_x
# use x value as default for y and z (if not specified)
if minimum_step_y is None:
self._minimum_step_y = minimum_step_x
else:
self._minimum_step_y = minimum_step_y
if minimum_step_z is None:
self._minimum_step_z = minimum_step_x
else:
self._minimum_step_z = minimum_step_z
self._finished = False
if comment:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment