A smooth shaft is a stepped cylindrical component made by joining multiple coaxial shaft sections along a common center axis. It consists...
Run
harbor run -t gnucleus-ai/freecad-5c60c7a002
Download
harbor download gnucleus-ai/freecad-5c60c7a002
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 shaft is a stepped cylindrical component made by joining multiple coaxial shaft sections along a common center axis. It consists of sequential shaft_section_1 through shaft_section_11, each defined by its corresponding shaft_section_n_diameter and shaft_section_n_length, with each new section starting at the end face of the previous section to form a continuous stepped profile.
Key parameters:
shaft_section_1
shaft_section_1_diameter = 10 mm
shaft_section_1_length = 20 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
shaft_section_6
shaft_section_6_diameter = 25 mm
shaft_section_6_length = 25 mm
shaft_section_7
shaft_section_7_diameter = 20 mm
shaft_section_7_length = 20 mm
shaft_section_8
shaft_section_8_diameter = 50 mm
shaft_section_8_length = 20 mm
shaft_section_9
shaft_section_9_diameter = 30 mm
shaft_section_9_length = 10 mm
shaft_section_10
shaft_section_10_diameter = 50 mm
shaft_section_10_length = 20 mm
shaft_section_11
shaft_section_11_diameter = 30 mm
shaft_section_11_length = 10 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.