Role: You are a mechanical design engineer proficient in CAD automation using Python scripting and the Fusion 360 API.
Objective: Develop a Python script that automates the creation of a parametric 3D spur gear model in Fusion 360. The script should allow user input for the module, number of teeth, and pressure angle.
Context:
- The gear is part of a modular robotics system.
- It should be compatible with 3D printing and laser cutting.
- Script is intended for engineers with basic Python knowledge but little experience with the Fusion 360 API.
Constraints:
- Pressure angle must default to 20°, with the option to change it.
- Gear type: spur gear only (no helical or bevel).
- Use metric units (mm).
- Gear profile must be fully parametric using user inputs.
- Code must include clear comments and basic input validation (e.g., teeth ≥ 6, module ≥ 0.5).
Deliverables:
- Python script using Fusion 360’s scripting environment or Add-In.
- Explanation of key parts of the script (e.g., how the involute curve is approximated).
- Sample usage example with inputs: module = 2, teeth = 24, pressure_angle = 20
- Optional: Output a gear preview or diagram of the generated model (in code or as a function).
Expected Output Example:
# Sample Output Snippet
# Inputs: module = 2, teeth = 24, pressure angle = 20
# Gear outer diameter = 52 mm
# Base circle radius = 20.39 mm
# Creating involute curve for gear tooth…
# 3D sketch created, extruded to 10 mm
# Gear model saved as ‘gear_24t_module2.f3d’
Bonus (Optional):
- Add an export function to save the gear as an STL file.
- Allow the user to specify gear thickness and bore diameter.
Tags: