Here’s a clear step-by-step guide on how to use rack and pinion mate in onshape(CAD Software).
How to Use Rack and Pinion Mate in Onshape
The Rack and Pinion Mate in Onshape creates a relationship between a rotating cylindrical part (pinion gear) and a translating linear part (rack), so that rotating the pinion moves the rack in a straight line — just like a real rack and pinion mechanism.
Step 1: Prepare Your Parts
- Pinion Part: A cylindrical gear or shaft that will rotate.
- Rack Part: A linear bar with teeth (or just a slider if you’re focusing on motion, not actual teeth).
- Ensure both parts are fully modeled and inserted into an Assembly.
Step 2: Apply Primary Mates
Before adding the rack and pinion relationship, make sure:
- The rack can slide linearly (use Slider Mate or Planar Mate to allow translation).
- The pinion can rotate (use Revolute Mate or Cylindrical Mate to allow rotation).
Step 3: Add the Rack and Pinion Mate
- In the Assembly toolbar, go to Mate Features → Rack and Pinion Mate.
- Select:
- Cylindrical face (or circular edge) of the pinion.
- Linear edge or sketch line along the rack’s path of motion.
- Enter the Pitch Circle Diameter (PCD) of the pinion gear — this defines the gear’s effective radius.
- Choose the direction of motion (clockwise/counterclockwise).
Step 4: Test the Mechanism
- Drag the pinion gear in the assembly.
- The rack should move linearly in sync with the rotation.
- If the direction is reversed, flip the direction setting in the mate options.
Step 5: Fine-Tune
- Adjust the pitch circle diameter if the travel distance does not match your gear design.
- Ensure no extra mates overconstrain the motion (it should move freely).
Tips
- You don’t need detailed gear teeth for motion simulation — a simple cylinder (pinion) and rectangular bar (rack) with correct pitch diameter works.
- Use Mate Connectors carefully so the axis of the pinion and the path of the rack are properly aligned.
- You can later add gear teeth for visual accuracy, but they aren’t necessary for the mate to function.
Other courses:


