A smooth stepped shaft is a coaxial cylindrical component composed of five consecutive shaft sections used to transmit torque or provide...
Run
harbor run -t gnucleus-ai/freecad-5c60c7a003
Download
harbor download gnucleus-ai/freecad-5c60c7a003
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 smooth stepped shaft is a coaxial cylindrical component composed of five consecutive shaft sections used to transmit torque or provide mounting diameters. It consists of shaft_section_1 through shaft_section_5 arranged in series along the shaft axis, each defined by its diameter and length (shaft_section_#diameter, shaft_section#_length). Each section is modeled as a solid cylinder and joined end-to-end concentrically to form a single continuous shaft profile.
Key parameters:
shaft_section_1
shaft_section_1_diameter = 10 mm
shaft_section_1_length = 40 mm
shaft_section_2
shaft_section_2_diameter = 15 mm
shaft_section_2_length = 30 mm
shaft_section_3
shaft_section_3_diameter = 20 mm
shaft_section_3_length = 40 mm
shaft_section_4
shaft_section_4_diameter = 40 mm
shaft_section_4_length = 10 mm
shaft_section_5
shaft_section_5_diameter = 30 mm
shaft_section_5_length = 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.