A high-profile hex flange nut consists of a hexagonal outer body with an integrated circular flange at one end and a plain cylindrical...
Run
harbor run -t gnucleus-ai/freecad-7c683fcc0b
Download
harbor download gnucleus-ai/freecad-7c683fcc0b
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 outer body with an integrated circular flange at one end and a plain cylindrical through hole running along the central axis. The overall form is tall relative to its footprint, with the flange providing a wider bearing surface at the base.
The central through hole is defined by inner_diameter, establishing the nut’s clearance and alignment along the axis.
The nut’s axial extent is governed by overall_height, which sets the full height from the flange face to the opposite end.
The integrated flange is characterized by flange_diameter and flange_thickness, defining its outer size and its axial protrusion from the base.
The hexagonal body width across its flats is controlled by hub_width, setting the primary gripping profile above the flange.
Key parameters:
inner_diameter = 24.0 mm
overall_height = 36.0 mm
flange_diameter = 45.0 mm
flange_thickness = 6.0 mm
hub_width = 36.0 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.