This comprehensive guide walks you through creating a 3D model of a gear in Onshape, with the potential for 3D printing. Assumes familiarity with Onshape.
Step-by-Step Process
Getting Started with the Wheel

Navigate to the front view.

Sketch a rectangle, starting from anywhere along the central vertical line.

Assign appropriate dimensions to the rectangle.

Draw a line horizontally across from the front view, aligning it with the origin.

Select the line and set it as a construction line.

Locate and click on the revolve tool. Choose the rectangle sketch as the face for revolution and the construction line as the axis.
Creating a Tooth

Switch to the right view of your document. Initiate a sketch on the right side of your wheel.

Draw a vertical line starting from the origin and extending beyond the edge of the wheel.

Sketch a circle with its center coinciding with the origin.

Determine the dimension as the variance between the two circles.

Draw two lines adjacent to both circles close to the previously drawn construction line.

Assign dimensions for the bottom points of the lines to match the construction line.

Allocate dimensions for the top points of the lines to align with the construction line.

Choose the area you just modified.

Utilize the Extrude tool. Eliminate that section from the wheel.

Access the Fillet tool. Apply it to the four yellow lines above. The default radius is 5mm, but you can opt for 2.5mm as well.
Finalizing

Utilize the Circular Pattern tool and convert from Part Pattern to Face Pattern. Highlight all the yellow faces mentioned above.

Choose the outer face of the wheel.

Determine how many times you wish to repeat the selected faces around the wheel.
Pro Tips
- Enhance this basic gear design by delving into gear theory.
- To create gears of different sizes, maintain the same tooth dimensions but adjust the height and tooth count of the rectangle accordingly. For example, to craft an 8-tooth gear that meshes properly with this one, the rectangle should be 18.75mm tall.