summaryrefslogtreecommitdiff
path: root/nc_files/ngcgui_lib/arc2.ngc
blob: d003f11ebed8bc9f9ae6cc69e49ab9c60fb691fe (plain)
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
(info: arc2: specify arc center, offset, angle)

;    dir: 2 for cw, 3 for ccw
; inside: 1 for inside, else outside

; Specify:
;         (xoff,yoff) == arc center
;         (xctr,yctr) == center of rotation
;         angle       == anglular spread of arc
;         width       == width of arc

; calls arc1.ngc

o<arc2> sub

#<toolno>      =  #1 (=1)
#<dir>         =  #2 (=2 2:cw 3:ccw)
#<inside>      =  #3 (=1 1:inside 0:outside)
#<rpm>         =  #4 (=2000)
#<feedrate>    =  #5 (=100)
#<zincr>       =  #6
#<cutdepth>    =  #7
#<zsafe>       =  #8 (=0.25)
#<zstart>      =  #9 (=0)
#<width>       = #10 (=.25)
#<angle>       = #11 (=15)
#<xoff>        = #12 (=2)
#<yoff>        = #13 (=1)
#<xctr>        = #14 (=0)
#<yctr>        = #15 (=0)
#<scale>       = #16 (=1)
#<spin_notify> = #17 (=0)
#<use_g43>     = #18 (=1)
#<h_for_g43>   = #19 (=0)
#<verbose>     = #20 (=0)

#<min_separation> = .1

  #<delx> = [#<xoff> - #<xctr>]
  #<dely> = [#<yoff> - #<yctr>]
 #<arc_r> = [SQRT[#<dely>*#<dely> + #<delx>*#<delx>]]
#<rotate> = [-90 + ATAN[#<dely>]/[#<delx>]]

o<if0> if [#<arc_r> LT #<min_separation>]
         (print, arc2: separation too small: #<arc_r> - EXITING)
         (debug, arc2: separation too small: #<arc_r> - EXITING)
         (AXIS,notify, arc2: separation too small - EXITING)
         m2
o<if0> endif


o<arc1>call[#<toolno>][#<dir>][#<inside>][#<rpm>][#<feedrate>][#<zincr>][#<cutdepth>][#<zsafe>][#<zstart>][#<width>][#<angle>][#<arc_r>][#<rotate>][#<xoff>][#<yoff>][#<scale>][#<spin_notify>][#<use_g43>][#<h_for_g43>][#<verbose>]

o<arc2> endsub