A 2 sections spur gear shaft consists of a spur gear mounted on a 2 section shaft. The shaft is constructed in 2 sections from bottom to...
Run
harbor run -t gnucleus-ai/freecad-c7ccc5660f
Download
harbor download gnucleus-ai/freecad-c7ccc5660f
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 2 sections spur gear shaft consists of a spur gear mounted on a 2 section shaft.
The shaft is constructed in 2 sections from bottom to top: The 1st section is a smooth cylindrical shaft defined by shaft_diameter and shaft_length.
The spur gear is mounted on the 2nd section of shaft along the axial direction. The spur gear is characterized by parameters such as gear_number_tooth, gear_module, gear_height, and pressure_angle. The gear teeth are created using an involute profile, repeated in a circular pattern to achieve the specified gear_number_tooth. The gear_height defines the axial thickness of the gear.
Key parameters:
Shaft (section_1: smooth shaft)
shaft_diameter = 16 mm
shaft_length = 30 mm
Spur gear (section_2)
gear_number_tooth = 20
gear_module = 1 mm
gear_height = 20 mm
pressure_angle = 20 degree
gear_pitch_diameter = gear_number_tooth * gear_module = 20 * 1 mm = 20 mm
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.