(info: helix: in/out cutting, cw/ccw dir with radius comp, D-holes) o sub # = #1 (=1) # = #2 (=2000) # = #3 (=10) # = #4 (=3 2:cw, 3:ccw) # = #5 (=1 1:in, 0:out) # = #6 (z cutdepth) # = #7 (z increment) # = #8 (=0.5) # = #9 (x center) # = #10 (y center) # = #11 (diameter) # = #12 (=0 face angle) # = #13 (=0 d angle) # = #14 (=0) #= #15 (=0) # = #16 (=1) # = #17 (=0) # = #18 (=0) o call [#][#][#][#] # = [#5410 + .001] #
= [#/2] # = [-1 * #] o if [# GT 0.0] (debug, helix: bad cutdepth # - EXITING) (print, helix: bad cutdepth # - EXITING) (AXIS,notify, helix: bad cutdepth - EXITING) m2 o endif # = [-1 * #] o if [# GT 0.0] (debug, helix: bad zincr # - EXITING) (print, helix: bad zincr # - EXITING) (AXIS,notify, helix: bad zincr - EXITING) m2 o endif o if [[# NE 0] AND [# NE 1]] (debug, helix: bad inside specifier # - EXITING) (print, helix: bad inside specifier # - EXITING) (AXIS,notify, helix: bad inside specifier - EXITING) m2 o endif o if [[# NE 2] AND [# NE 3]] (debug, helix: bad dir specifier # - EXITING) (print, helix: bad dir specifier # - EXITING) (AXIS,notify, helix: bad dir specifier - EXITING) m2 o endif # = [# / 2.0] G40 (cutter radius compensation off) s# m3 (spindle cw) o if [# GT 0] o call [#] o endif f # # = # # = [#/2] (to avoid gouging, start point is arc opposite flat) (start point x0,y0 and vector to center vx0,vy0) # = [# + #
* cos[# + 180]] # = [# + #
* sin[# + 180]] # = [#
* cos[#]] # = [#
* sin[#]] o call [#][#][#][#][#][#][#] # = #<_entry:prex> (pre entry point) # = #<_entry:prey> # = #<_entry:vx> (vector to arc center) # = #<_entry:vy> (points at the ends of the arc) (x1,y1 start point of flat, vx1,vy1 vector to center) (x2,y2 start point of flat, vx2,vy2 vector to center) o if [# eq 2] (cw) # = [# + #
* cos[# + #]] # = [# + #
* sin[# + #]] # = [#
* cos[# + # + 180]] # = [#
* sin[# + # + 180]] # = [# + #
* cos[# - #]] # = [# + #
* sin[# - #]] # = [#
* cos[# - # + 180]] # = [#
* sin[# - # + 180]] o else # = [# + #
* cos[# + #]] # = [# + #
* sin[# + #]] # = [#
* cos[# + # + 180]] # = [#
* sin[# + # + 180]] # = [# + #
* cos[# - #]] # = [# + #
* sin[# - #]] # = [#
* cos[# - # + 180]] # = [#
* sin[# - # + 180]] o endif g0 z # o if [# NE 0] (inside) o if [# eq 2] (cw) (debug conventional CW,INSIDE) g0 x# y# z # / g42 (cutter radius comp right of path) g2 x# y# i# j# o else (ccw) (debug climb CCW,INSIDE) g0 x# y# z # / g41 (cutter radius comp left of path) g3 x# y# i# j# o endif o else (outside) o if [# eq 2] (2 ==> cw) (debug,climb CW,OUTSIDE) g0 x# y# z # / g41 (cutter radius comp left of path) g3 x# y# i# j# o else (3 ==> ccw) (debug conventional CCW,OUTSIDE) g0 x# y# z # / g42 (cutter radius comp right of path) g2 x# y# i# j# o endif o endif (entry complete: #,#,#) g0 z [# + 0.05] (hardcoded delta) g1 z # (plunge) # = # #<_:pass> = 1 (colon makes hidden global var) o while [# GT #] # = [# + #] o if [# LT #] # = # o endif g# x# y# i# j# z# g1 x# y# g# x# y# i# j# z# #<_:pass> = [#<_:pass> + 1] o endwhile (final traverse at full depth) g# x# y# i# j# z# g1 x# y# g# x# y# i# j# z# g0 z# g40 o endsub