If you have a mini lathe with a 16TPI lead screw you can print a 27-tooth change gear that will index your spindle to exactly 18 degree increments. But you also will need some way to drive the lead screw (as in, a handwheel attached to the end of the LS).
The way this works: The change gears establish a ratio between spindle rotations vs. LS rotations. The start of an indexing scheme, eh? If you choose A = 27 B = 57 C = 80 and D = 40 that would cut a 16.888888.... TPI thread, but what you're really after is getting the right turns ratio, and that's what the given change gear set achieves.
To use this to cut your splines you would start with the LS crank at a known position, broach one tooth, then rotate the LS exactly ONE turn and repeat until done.
I didn't come up with this scheme to cut gears or splines, but to scribe divisions on dials. FYI printing a 47T change gear will create 100 divisions with a .0082% error. A dial with 50 divisions can be scribed with 0% error, but not with a 47T gear -- it requires a 34T gear. I haven't explored the possibility of using any allowable gear ratio yet but expect it's likely possible to get zero error for 100 divisions that way. The minimum-possible gear is 21T, maximum may only be somewhat greater than 80T (due to mechanical interference).
I have found the LS-mounted handwheel to be a useful addition to my mini lathe. I made a plinth I can use to replace the compound slide, which greatly increases the rigidity of the machine for doing parting off operations, and I use the handwheel to precisely locate the cut off tool. It also makes it much easier to smoothly turn longer pieces, compared to trying to slowly & evenly turn the apron's handwheel. Finally, it can be used to cut coarser threads, where the lead screw's mechanical advantage (MA) exceeds the MA from the spindle side of the gear chain.
This scheme should work for other lathes as well, but the actual change gear to-be-printed would depend on what gears you already have and what TPI (or mm pitch) your lead screw is.