I'm going to attempt it on my Tormach and use the CNC for the motion. I have an existing gear to reverse engineer from, measured the depth, outside diameter, etc. I don't know the proper terminology, apologize for my descriptions, plan on figuring out the helix by dead reckoning.
In my case, the blank is at a 45 as the two gears meet at a 90. I measured the depth at something like 0.315". Cos/Sin (45) times 0.315" tells me the translation in X and Z will need to be 0.223". Once I find the rod, will need to move X/Z in the negative direction at the same rate.
To find the helix (?) angle or rotation during the move, I plan on rotating the 4th axis so the top of the cutter fits into the existing gear. Then back out the Y, move the X/Z 0.223", then rotate the A-axis and advance the Y. Keep tweaking the A-axis and Y until the cutter fits correctly at the bottom of the gear.
Suppose it's 70 deg. of rotation during the X/Z move of 0.223". My G-code routine will be something like "G1 X -0.223 Z -0.223 A 70".
I tried interpreting what to do from Machinery's Handbook and got a headache. . . Hopefully my reverse engineering will be close enough.
I'll end up cutting a longer length than just 0.315" along the blank. Below is a sketch of the part I'm making. Figure once I have the set up, I'll try to machine around 1.4" of gear which will give me two of these parts (after the lathe work). That'll make my routine something like "G1 X -1.559 Z -1.559 A 490" (7X of one gear). The stock in my case is brass at 0.558" diameter, hopefully rigid enough for that length of stick out of a 5C collet.
Current hurdle is my 4th axis stepper motor went wonky on me 2 days ago. Just bounces back and forth. Hopefully just a cable issue as the motor checks out per Tormach's troubleshooting and the stepper driver has the "green" LED lit.
Bruce