;chamfer O sub # = #<_ccomp> # = #<_metric> # = #<_absolute> # = #<_feed> # = #<_coord_system> # = #<_lathe_diameter_mode> # = #<_ijk_absolute_mode> G8 ; Lathe radius Mode G90 ; Absolute Distance ; #1 X coord ; #2 feed/rpm ; #3 0.5 ? ; #4 0 ? ; #5 Z coord ; #6 tool number ; #7 0 ? ; #8 chamfer size ; #9 exterior front ; #10 interior ; #11 exterior rear ; #12 coolant O10 if [#12 EQ 1] M8 O10 endif ;M6 T#6 G43 O100 if [#6 NE #<_current_tool>] (MSG, ERROR : Set tool before use macro) O call [#] [#] [#] [#] [#] [#] [#] O100 return [-2] ; indicate failure to epilog O100 endif #1 = [#1 / 2] ; because of radius mode #14 = [#<_x>] (starting X) #13 = [#<_z>] (starting Z) G96 D2500 S#2 ; Constant Surface Speed Mode M3 G95 F0.1 ; Feed-Per-Rev Mode #20 = 0 O101 if [#9 GT 0.5] ; front outside o102 while [[#20 + #3] lt #8] #20 = [#20 + #3] G0 x[#1 - #20] z#13 G1 z#5 G1 x#1 z[#5 - #20] G1 x #14 G0 z#13 o102 endwhile G0 x#14 z#13 G0 x[#1 - #8] G1 z#5 G1 x#1 z[#5 - #8] G1 x #14 G0 z#13 O101 elseif [#10 GT 0.5] ; front inside o103 while [[#20 + #3] lt #8] #20 = [#20 + #3] G0 x[#1 + #20] z#13 G1 z#5 G1 x#1 z[#5 - #20] G1 x #14 G0 z#13 o103 endwhile G0 x#14 z#13 G0 x[#1 + #8] G1 z#5 G1 x#1 z[#5 - #8] G1 x #14 G0 z#13 O101 elseif [#11 GT 0.5] ; back outside o104 while [[#20 + #3] lt #8] #20 = [#20 + #3] G0 x[#1 - #20] z#13 G1 z#5 G1 x#1 z[#5 + #20] G1 x #14 G0 z#13 o104 endwhile G0 x#14 z#13 G0 x[#1 - #8] G1 z#5 G1 x#1 z[#5 + #8] G1 x #14 G0 z#13 O101 endif M5 M9 ; restore g20/21, g90/g91, feed O call [#] [#] [#] [#] [#] [#] [#] O endsub M2 %