This fix was done for a local Repair Café.
This is a replacement gear that is press fit on the motor shaft of the pencil sharpener. The gear was generated using https://www.stlgears.com/generators/3dprint with the parameters in this screenshot:
a small offset of 2mm was added a recess on the bottom of that using OpenScad. The motor shaft requires a 2.5 mm diameter but the stlgears site does not properly generate an stl for this small a gear. So I needed to ream the inside hole with a 3/32 in drill. The gear can then be press fit into place.
The part is printed in PLA with a 0.15 mm layer height and a large brim.
This is a photo of the gear in place and covered with silicon grease.
The author marked this model as their own original creation.