Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python
- # This spiral drilling gcode generator by Dmitry Platonov is public domain
- # Feel free to edit, distribute and use it any way you like
- # contact author [email protected]
- #setup
- feed = 800
- feed_finish = 100
- center_x = 25.0
- center_y = 90.0
- safe_z = 15.0
- start_z = 0.0
- stop_z = -24.0
- step_z = -2.0
- r = 1.1
- #setup end
- base_x = center_x - r
- base_y = center_y
- cur_z = start_z
- print "G0 Z%.4f" % (safe_z,)
- print "G0 X%.4f Y%.4f" % (base_x, base_y)
- print "G0 Z%.4f" % (start_z,)
- while cur_z > stop_z:
- cur_z += step_z
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed)
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed)
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed)
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed)
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed_finish)
- print "G3 X%.4f Y%.4f I%.4f J0 Z%.4f F%f" % (base_x, base_y, r, cur_z, feed_finish)
- print "G0 X%.4f Y%.4f Z%.4f" % (center_x, center_y, safe_z)
- print "M30"
- print "%"
Advertisement
Add Comment
Please, Sign In to add comment