A half moon key, also known as a Woodruff key, is a semi-circular, disk-shaped mechanical component used to connect a rotating element to a...
Run
harbor run -t gnucleus-ai/freecad-33e0cf86f9
Download
harbor download gnucleus-ai/freecad-33e0cf86f9
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 half moon key, also known as a Woodruff key, is a semi-circular, disk-shaped mechanical component used to connect a rotating element to a shaft. It typically fits into a corresponding keyway in the shaft and the rotating element, ensuring proper alignment and torque transmission.
Key parameters for drawing a half moon key in CAD include the diameter of the key (which determines the size of the semi-circular part), the moon_height of the key (which is top of the semi-circle to the bottom of the key), and thickness of the key. Additionally, the keyway dimensions on both the shaft and the rotating element must be considered to ensure a proper fit.
Key parameters:
diameter=4.0mm
moon_height=1.4mm
key_thickness=1.0mm
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.