Sorry, I realize my answer could be taken the wrong way. Yes, I gave you the tools I typically would use when measuring and or copying a gear for the purpose of 3D printing. OpenSCAD is a great tool and the entire concept of parametric (the idea of variables or settings) for simple geometric brackets, shapes, gears, pulleys, and other similar items is an incredibly useful tool.
Your efforts, learning the machine, 3D printing, CAD design, and calibration, at some point you might have to or need to print a custom gear.
The flipside is, there are limitations to 3D printing and no- it's not always a replacement for other manufacturing methods and materials. Especially the smaller gears with bare minimum tooth counts around a given shaft. Proper injection molded gears are typically stronger and wear longer, run smoother, and especially in a small press fit onto a shaft situation, less likely to split in my experience.
Even though at one point, I had more 3D printers than I could count, and was knee deep into a few manufacturers, I have both resin and FDM printers, again, a gear- especially a small pinion motor gear, I'm probably not jumping to 3D printing as my repair method for most tiny gear trains.
Yes, if I had no other choice, simply could not buy a given specialized gear, then maybe go down the 3D printing path, but even then I might get caught into the cycle of design, print, adjust, reprint, adjust, reprint, and then print spares to see how long it holds up in the real use case.
Bottom line, 3D printing is a great tool. Just like any other tool there is things you find out it's ideal and maybe even the best tool, but flipside, there are situations and scenarios, yeah you can design and 3D print it, but in the picture of things, is that the best option?
I'm just trying to give you both options. How to design and 3D print common gears in custom configurations in a relatively simple way.
If that fails, or is just not working out, a fallback plan in that there are cheap common gear assortments available, and sometimes that is just an easier and more robust method.