(outside traverse arbitrary quadrangle) (computes direction for polygon cw or ccw and swaps if required) (info: oquad: outside quadrilateral, specify four x,y points) o sub # = #1 (=1) # = #2 (=1) # = #3 (=2 2conv|3climb) # = #4 (=10) # = #5 # = #6 # = #7 (=0.2) # = #8 (=0) # = #9 # = #10 # = #11 # = #12 # = #13 # = #14 # = #15 # = #16 # = #17 (=1) # = #18 (=0) # = #19 (=0) # = #20 (=0) # = #21 (=0) # = #22 (=1) # = #23 (=0) # = #24 (=0) o if [# EQ 0] # = 1.0 (debug, scale was 0, setting #) o endif o call [#][#][#][#] # = [#5410 + .001] o if [[# NE 2] AND [# NE 3]] (debug, oquad: bogus direction # - EXITING) (print, oquad: bogus direction # - EXITING) (AXIS,notify, oquad: bogus direction - EXITING) m2 o endif (determine direction eg cw or ccw of points) o call [4][#][#][#][#][#][#][#][#] # = #<_dir:> o if [# NE #] (swap 1234 --> 1432) # = # # = # # = # # = # # = # # = # o endif (apply scale, rotate, then offset to all input points) o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> o call [#][#][#][#][#][#] # = #<_move:x> # = #<_move:y> # = [#/2] # = [0 - #] # = [0 - #] (get lengths and angles for connecting lines) o call [#][#][#][#] # = #<_line:phi> g40 (cutter radius compensation off) f # s # m3 (spindle cw) o if [# GT 0] o call [#] o endif g0 z# # = # # = 1 o while [# GT #] # = [# + #] o if [# LT #] # = # o endif o if [# GT 100] (debug, oquad: too many passes - EXITING) (print, oquad: too many passes - EXITING) (AXIS,notify, oquad: too many passes - EXITING) m2 o endif o if [# EQ 1] o if [# EQ 2] # = [# - # * sin[#] - # * cos[#]] # = [# + # * cos[#] - # * sin[#]] # = [ # * cos[#]] (b to arc center) # = [ # * sin[#]] g0 x # y # / g41 (cutter radius comp left of path) g3 x # y # i # j # (arc entry) o else (dir EQ 3 CCW) # = [# + # * sin[#] - # * cos[#]] # = [# - # * cos[#] - # * sin[#]] # = [ # * cos[#]] (b to arc center) # = [ # * sin[#]] g0 x # y # / g42 (cutter radius comp right of path) g2 x # y # i # j # (arc entry) o endif # = # # = # g1 z # (plunge to start height todo:g0) o endif x # y # z# (ramp down to zcurrent) x # y # x # y # x # y # # = [# + 1] o endwhile g1 x # y # g0 z # g40 o endsub