A spur gear stock consists of a cylindrical gear body with external involute teeth distributed around the outside, extruded along the gear...
Run
harbor run -t gnucleus-ai/freecad-aff93db55d
Download
harbor download gnucleus-ai/freecad-aff93db55d
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 stock consists of a cylindrical gear body with external involute teeth distributed around the outside, extruded along the gear axis to form the overall length.
The tooth geometry and spacing are governed by number_of_teeth, diametral_pitch, gear_module, and pressure_angle, with the tooth form sized relative to pitch_diameter and outer_diameter.
The axial extent of the stock is defined by overall_length, producing a uniform face width along the gear’s rotation axis.
Key parameters:
pressure_angle = 20 degrees
diametral_pitch = 20
number_of_teeth = 16
pitch_diameter = 0.8 in = 20.32 mm
outer_diameter = 0.9 in = 22.86 mm
overall_length = 1 ft = 304.8 mm
gear_module = 25.4 / diametral_pitch = 25.4 / 20 = 1.27 mm # AGMA / ISO 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.