My motor already had a gear attached, but it was tiny and would have caused some issues with a normal 3d print. For the matching gear, I halved the extruded line thickness on the outer edge, to ensure tolerances were ok. Worked fine. For the remaining...