A high-profile hex flange nut consists of a hexagonal nut body with an integral circular flange at its base, and a plain through hole...
Run
harbor run -t gnucleus-ai/freecad-cda06f9dbf
Download
harbor download gnucleus-ai/freecad-cda06f9dbf
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 high-profile hex flange nut consists of a hexagonal nut body with an integral circular flange at its base, and a plain through hole running axially through the entire part.
The through hole is defined by inner_diameter, and it is centered on the nut’s main axis to provide a clearance passage.
The overall axial size of the nut is set by overall_height. The hexagonal exterior is characterized by hex_nut_width_across_flats, hex_nut_width_across_corners, and hex_nut_half_angle, which control the wrenching geometry and corner profile.
The integrated flange is defined by flange_diameter and flange_thickness, forming a wider bearing surface concentric with the nut body.
Key parameters:
inner_diameter = 10.0 mm
overall_height = 15.0 mm
flange_diameter = 22.0 mm
flange_thickness = 4.0 mm
hex_nut_width_across_flats = 16.0 mm
hex_nut_width_across_corners = hex_nut_width_across_flats/cos(30) = 16.0mm/cos(30degrees) = 18.475208614068023 mm # DIN 6331
hex_nut_half_angle = 30.0 degrees # DIN 6331
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.