A smooth stepped shaft composed of eight coaxial cylindrical sections (section_1 through section_8) revolved/extruded along a common center...
Run
harbor run -t gnucleus-ai/freecad-5c60c7a005
Download
harbor download gnucleus-ai/freecad-5c60c7a005
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 composed of eight coaxial cylindrical sections (section_1 through section_8) revolved/extruded along a common center axis. Each section is defined by its section_i_diameter and section_i_length, stacked sequentially end-to-end to form a continuous smooth profile without threads or splines.
Key parameters:
Section 1
section_1_diameter = 10 mm
section_1_length = 20 mm
Section 2
section_2_diameter = 15 mm
section_2_length = 30 mm
Section 3
section_3_diameter = 20 mm
section_3_length = 40 mm
Section 4
section_4_diameter = 40 mm
section_4_length = 10 mm
Section 5
section_5_diameter = 30 mm
section_5_length = 20 mm
Section 6
section_6_diameter = 25 mm
section_6_length = 25 mm
Section 7
section_7_diameter = 20 mm
section_7_length = 20 mm
Section 8
section_8_diameter = 50 mm
section_8_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.