Commit 6b0fc7a6 authored by paulusmax's avatar paulusmax

made a minimum step distance for the Gcode exporter to allow configs for...

made a minimum step distance for the Gcode exporter to allow configs for diferent resolution machines.  Also, the Gcode without this was making duplicate entries which causes the machine to stop and start inducing vibrations.

git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@925 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6d0cf4d0
......@@ -101,11 +101,28 @@ class GCodeGenerator:
if self.toggle_spindle_status:
self.append("M3 (start spindle)")
self.append(self.gcode.delay(2))
# At minimum this will stop the duplicate gcode
# And this is a place holder for when the GUI is linked
ResLimitX = 0.0001
ResLimitY = 0.0001
ResLimitZ = 0.0001
OldPosition = None
for pos, rapid in moves:
if OldPosition == None:
OldPosition = pos
NewPosition = pos
if rapid:
self.append(self.gcode.rapid(pos.x, pos.y, pos.z))
else:
# make sure we arent putting out values with no motion
if NewPosition.x - OldPosition.x >= ResLimitX \
or NewPosition.x - OldPosition.x <= -ResLimitX \
or NewPosition.y - OldPosition.y >= ResLimitY \
or NewPosition.y - OldPosition.y <= -ResLimitY \
or NewPosition.z - OldPosition.z >= ResLimitZ \
or NewPosition.z - OldPosition.z <= -ResLimitZ:
self.append(self.gcode.cut(pos.x, pos.y, pos.z))
OldPosition = pos
# go back to safety height
self.append(self.gcode.safety())
if self.toggle_spindle_status:
......
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