Files
linuxcnc/nc_files/MMHR-PALMREST.ngc
Thaddeus-Maximus f3953d66ae ?
2026-04-03 15:58:58 -05:00

130 lines
2.5 KiB
Plaintext
Executable File

#<_z_clearance> = 0.2
M03
G20 ; G21 mm, G20 inches
G91.1 ; absolute IJK
G54 ; absolute coordinates
#<_z_ctr> = 0.550
#<_x_start> = 0.0
#<_x_end> = 7.0
#<_r> = 0.945
#<_x_step> = 0.05
#<x> = #<_x_start>
#<op> = 21
o200 sub ;[Y][Z]
G0 Z[#<_z_clearance>]
G0 X[#<_x_start>-#<_td>] Y[#1]
G0 Z[#2]
G1 X[#<_x_end>+#<_td>]
G0 Y[-#1]
G1 X[#<_x_start>-#<_td>]
o200 endsub
#<_td> = 0.75
#<_r_adj> = [#<_r> - #<_td>/2]
#<theta> = ACOS[[#<_z_ctr>-#<_td>/2]/#<_r_adj>]
;#<z_bot> = [#<_z_ctr> - #<_r_adj>]
#<y_top> = [#<_r_adj>*SIN[#<theta>]]
o10 if [#<op> EQ 1]
#<_td> = 0.5
F5
o200 call [0][-.35]
o200 call [0.1][-.25]
o200 call [0.2][-.10]
o10 elseif [#<op> EQ 2]
F10
G0 Z#<_z_clearance>
G0 X#<_x_start> Y0
G0 Z0
#<t> = #<theta>
; o105 while [#<t> LT #<theta>]
o200 call [SIN[#<t>]*#<_r_adj>][#<_z_ctr>-COS[#<t>]*#<_r_adj>-#<_td>/2]
#<t> = [#<t> + 2]
; o105 endwhile
o10 elseif [#<op> EQ 3]
F30
G0 Z#<_z_clearance>
G0 X#<_x_start> Y0
G0 Z0
G90.1; use IJK absolute
G19; use YZ plane for round moves
#<x> = #<_x_start>
#<i> = 0
o100 while [#<x> LT #<_x_end>]
#<x> = [#<x> + #<_x_step>]
#<i> = [#<i> + 1]
;G1 X#<x>
o101 if [#<i> MOD 2]
G1 X#<x> Y+#<y_top> Z0
G2 X#<x> Y-#<y_top> Z0 J0 K[#<_z_ctr>-#<_td>/2]
o101 else
G1 X#<x> Y-#<y_top> Z0
G3 X#<x> Y+#<y_top> Z0 J0 K[#<_z_ctr>-#<_td>/2]
o101 endif
o100 endwhile
o10 elseif [#<op> EQ 11]
#<_td> = [3/16]
F4
;o<slot_chop> call [1.476][-.232] [1.476][+.232] [5.5/25.4] [0.0][-0.4]
o<slot> call [2.264][-.232] [2.264][+.232] [7.0/25.4] [0.0][-0.4]
o<slot> call [2.264][-.232] [2.264][+.232] [8.5/25.4] [0.0][-0.4]
o<slot> call [2.264][-.232] [2.264][+.232] [10.0/25.4] [0.0][-0.4]
;o<slot_chop> call [3.051][-.232] [3.051][+.232] [5.5/25.4] [0.0][-0.4]
o10 elseif [#<op> EQ 12]
#<_td> = [5/25.4]
F4
o<slot> call [1.476][-.232] [1.476][+.232] [9.5/25.4] [0.0][-3.2/25.4]
o<slot> call [2.264][-.232] [2.264][+.232] [14/25.4] [0.0][-3.2/25.4]
o<slot> call [3.051][-.232] [3.051][+.232] [9.5/25.4] [0.0][-3.2/25.4]
o10 elseif [#<op> EQ 21]
#<_td> = [7/16]
#<_rc> = 0.3
#<_yr> = 1.005
F10
#<t> = 0
o300 while [#<t> LT 90]
#<y> = [#<_yr>-#<_rc>+[#<_rc>+#<_td>/2]*COS[#<t>]]
#<z> = [-#<_rc>+[#<_rc>+#<_td>/2]*SIN[#<t>]-#<_td>/2]
o200 call [#<y>][#<z>]
#<t> = [#<t> + 10]
o300 endwhile
o10 endif
G0 Z#<_z_clearance>
M05
M30