A spur gear consists of a toothed gear body, a central hub, and a round through bore aligned on the rotational axis. The toothed gear body...
Run
harbor run -t gnucleus-ai/freecad-8dce996259
Download
harbor download gnucleus-ai/freecad-8dce996259
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 toothed gear body, a central hub, and a round through bore aligned on the rotational axis.
The toothed gear body is defined by number_of_teeth, gear_module, pressure_angle, pitch_diameter, outer_diameter, root_diameter, addendum, dedendum, and face_width.
The central hub is integrated concentrically with the gear body and is governed by hub_diameter, hub_width, and overall_width.
The round bore passes through the center of the gear and hub, and is defined by shaft_diameter.
Key parameters:
pressure_angle = 20 degrees
gear_module = 1 mm
number_of_teeth = 50
pitch_diameter = 50 mm
outer_diameter = 52 mm
face_width = 6 mm
hub_diameter = 16 mm
hub_width = 8 mm
shaft_diameter = 8 mm
overall_width = 14 mm
addendum = pitch_diameter / number_of_teeth = 50 mm / 50 = 1 mm # ISO 54 / standard spur gear geometry
dedendum = 1.25 * gear_module = 1.25 * 1 = 1.25 mm # ISO 54 / standard spur gear geometry
root_diameter = pitch_diameter - 2 * dedendum = 50 mm - 2 * 1.25 mm = 47.5 mm # ISO 54 / standard spur gear geometry
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.