(adapted from useful-subroutines.ngc) (Original file is Copyright 2006 Chris Radek and released under the GPL v2.) (info: slot: specify x1,y1 and x2,y2, applies radius compensation) o sub # = #1 (=1) # = #2 (=2000) # = #3 (=10) # = #4 # = #5 # = #6 (=0.5) # = #7 (=0.005) # = #8 (x1 center) # = #9 (y1 center) # = #10 (x2 center) # = #11 (y2 center) # = #12 # = #13 (=1) # = #14 (=0) # = #15 (=0) # = #16 (=0) # = #17 (=0) # = #18 (=1) # = #19 (=0) # = #20 (=0) o if [# EQ 0] # = 1.0 (debug, scale was 0, setting #) o endif # = [# * #] o call [#][#][#][#] # = [#5410 + .001] o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> # = #<_move:len> # = #<_move:phi> o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> # = #<_move:len> # = #<_move:phi> #=[#/2] (radius) #=[[atan [#-#]/[#-#]] + 180] ("backward" direction) #=[# + 90] ("right" side direction) #=[# * [cos [#]]] #=[# * [sin [#]]] #=[# * [cos [#]]] #=[# * [sin [#]]] s # m3 o if [# GT 0] o call [#] o endif f# g0 z# g0 x[#+#+#] y[#+#+#] g41 g1 x[#+#] y[#+#] g1 z# (#=[#/2] rule-of-thumb) #=# #=[#-#] (z) (down toward the specified depth a bit at a time) o201 while [# GT [0-#]] g1 x[#+#] y[#+#] z# g3 x[#-#] y[#-#] r# g1 x[#-#] y[#-#] g3 x[#+#] y[#+#] r# #=[#-#] o201 endwhile (down to the actual depth and one more cut) g1 x[#+#] y[#+#] z[0-#] g3 x[#-#] y[#-#] r# g1 x[#-#] y[#-#] g3 x[#+#] y[#+#] r# g1 x[#+#] y[#+#] g0 z# g40 o endsub