A spur gear consists of a cylindrical gear body with external involute teeth, a central hub, and a round bore for mounting on a shaft. The...
Run
harbor run -t gnucleus-ai/freecad-1db55e40f2
Download
harbor download gnucleus-ai/freecad-1db55e40f2
Details
Revision
2
Published
Sep 3, 2026
Visibility
Public
Authors
gNucleus AI, Inc.
Content hash
Keywords
freecad
cad
parametric
geometry
python
Write a FreeCAD Python script to answer.py that reproduces the
part described below.
The model must be built as a parametric feature tree inside a single PartDesign Body,
producing exactly one solid body. Use editable PartDesign features to construct the
model for better parameterization.The saved FCStd must contain named document objects
whose properties drive the geometry, not a single Part::Feature holding
a pre-computed TopoShape.
Save the generated model as an .FCStd file next to the script, using
the script stem as the output basename. The output path must be derived
from __file__ at runtime; do not hardcode the path or rely on the
current working directory. Only the FCStd written next to the executing
script file is graded.
Part description:
A spur gear consists of a cylindrical gear body with external involute teeth, a central hub, and a round bore for mounting on a shaft.
The toothed gear body is defined by number_of_teeth, gear_module, pressure_angle, face_width, pitch_diameter, outer_diameter, base_diameter, root_diameter, addendum, dedendum, whole_depth, clearance, circular_pitch, and tooth_thickness.
The hub is integrated concentrically with the gear body and is governed by hub_diameter, hub_width, and overall_width.
The central bore passes through the gear axis and is characterized by shaft_diameter.
Key parameters:
pressure_angle = 20 degrees
gear_module = 1.5 mm
number_of_teeth = 80
pitch_diameter = 120 mm
outer_diameter = 123 mm
face_width = 15 mm
hub_diameter = 55 mm
hub_width = 10 mm
shaft_diameter = 12 mm
overall_width = 25 mm
addendum = gear_module = 1.5 = 1.5 mm # ISO 54 / DIN 867
dedendum = 1.25 * gear_module = 1.25 * 1.5 = 1.875 mm # ISO 54 / DIN 867
whole_depth = addendum + dedendum = 1.5 + 1.875 = 3.375 mm # ISO 54 / DIN 867
clearance = dedendum - addendum = 1.875 - 1.5 = 0.375 mm # ISO 54 / DIN 867
base_diameter = pitch_diameter * cos(pressure_angle) = 120 * cos(20) = 112.763 mm # ISO 21771
circular_pitch = pi * gear_module = pi * 1.5 = 4.712 mm # ISO 54
tooth_thickness = circular_pitch / 2 = 4.712 / 2 = 2.356 mm # ISO 54
root_diameter = pitch_diameter - (2 * dedendum) = 120 - (2 * 1.875) = 116.25 mm # ISO 54 / DIN 867
FreeCAD version: 1.1.0.
Output location: write your script to /app/answer.py and the generated model to /app/answer.FCStd. The verifier reads from these exact paths; files saved anywhere else are not graded.