-
Notifications
You must be signed in to change notification settings - Fork 2
/
chamfer.ngc
77 lines (68 loc) · 1.09 KB
/
chamfer.ngc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
;chamfer
O<chamfer> sub
G8 ; Lathe radius Mode
G18 ; XZ Plane
G21 ; Metric Units
G90 ; Absolute Distance
M6 T#6 G43
#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (starting X)
#13 = [#<_z>] (starting Z)
G96 D1500 S#2 ; Constant Surface Speed Mode
M3
g95 F0.1 ; Feed-Per-Rev Mode
O90 IF [#12 GT 0.5]
M8
O90 ENDIF
#20 = 0
O101 if [#9 GT 0.5] ; front outside
o100 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
o100 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
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 [#11 GT 0.5] ; back outside
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 endif
M5 M9
G7
O<chamfer> endsub
m2
%