; bore - helical boring subroutine. Spirals down in full-circle passes, ; then a partial-arc cleanup and a spring pass at final depth. ; Requires globals: #<_z_top>, #<_z_bot> ; Requires tool loaded (uses #5410 for diameter) o sub ; o call [x][y] [d] [stepdown] ; #1=x #2=y #3=d #4=stepdown G90 G91.1 G0 X#1 Y#2 G0 Z#<_z_top> G1 X[#1+#3/2-#5410/2] Y[#2] G17 # = [#3/2-#5410/2] # = [#<_z_top> - #4] o101 while [# GT #<_z_bot>] G3 X[#1+#] Y[#2] I[-#] Z[#] P1 # = [# - #4] o101 endwhile o102 if [#<_z_top> GT #<_z_bot>] # = [[#-#<_z_bot>]/#4*360] G3 X[#1+COS[#]*#] Y[#2+SIN[#]*#] I[-#] Z[#<_z_bot>] G3 X[#1+COS[#]*#] Y[#2+SIN[#]*#] I[-COS[#]*#] J[-SIN[#]*#] Z[#<_z_bot>] o102 endif G0 X#1 Y#2 G0 Z0 o endsub M2