; ngcgui-compatible subroutine
(info: helix in each quadrant at angles B,C)
o<xyzbc_switchkins_sub>sub
   #<zmax> = #1 (=10)
   #<zmin> = #2 (= 5)
      #<r> = #3 (=10 radius)
  #<frate> = #4 (=1000 feedrate)
      #<n> = #5 (=3  n circles)
      #<a> = #6 (=0  A angle NA)
      #<b> = #7 (=30 B angle)
      #<c> = #8 (=45 C angle)
   #<dist> = #9 (=20 distance)

; quadrant I
M429                            ;Identity kinematics
g53 g0   x0y0 z#<zmax> b0 c0    ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> b0 c0    ;new g54
g0 x+#<dist> y+#<dist> z#<zmax> ;move to pattern center position
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]

; quadrant II
M429                            ;Identity kinematics
g53 g0   x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x-#<dist> y+#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]

; quadrant III
M429                            ;Identity kinematics
g53 g0   x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x-#<dist> y-#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]

; quadrant IV
M429                            ;Identity kinematics
g53 g0   x0y0 z#<zmax> b0 c0
g10l20p0 x0y0 z#<zmax> b0 c0
g0 x+#<dist> y-#<dist> z#<zmax>
o<helix_bc> call [#<zmax>][#<zmin>][#<r>][#<frate>][#<n>][#<a>][#<b>][#<c>]

;final position
M429                            ;Identity kinematics
g53 g0   x0y0 z#<zmax> ;MACHINE coordinates
g10l20p0 x0y0 z#<zmax> ;new g54

o<xyzbc_switchkins_sub>endsub
