A metric hex flange nut consists of a central plain through-hole passing through a combined hexagonal nut body and an integral circular...
Run
harbor run -t gnucleus-ai/freecad-58fd45a90e
Download
harbor download gnucleus-ai/freecad-58fd45a90e
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 metric hex flange nut consists of a central plain through-hole passing through a combined hexagonal nut body and an integral circular flange at the base.
The through-hole is defined by inner_diameter and runs the full axial length set by overall_height.
The hexagonal nut body is characterized by hex_head_width_across_flats, hex_head_width_across_corners, and hex_head_angle, which define the wrenching profile and edge/chamfer geometry.
The integrated flange is characterized by flange_diameter and flange_thickness, forming a wider bearing surface at the base of the nut body.
Key parameters:
inner_diameter = 8.0 mm
overall_height = 8.0 mm
flange_diameter = 17.9 mm
flange_thickness = 3.5 mm
hex_head_width_across_flats = 13.0 mm
hex_head_width_across_corners = hex_head_width_across_flats/cos(30) = 13.0mm/cos(30degrees) = 15.011106998930272 mm # ISO 4161
hex_head_angle = 30.0 degrees # ISO 4161
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.