A hex flange nut consists of a hexagonal nut body with an integral circular flange at one end and a plain through-hole along the central...
Run
harbor run -t gnucleus-ai/freecad-669bfb187c
Download
harbor download gnucleus-ai/freecad-669bfb187c
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 hex flange nut consists of a hexagonal nut body with an integral circular flange at one end and a plain through-hole along the central axis.
The overall nut height is governed by overall_height. The hexagonal exterior profile is characterized by hub_width, which defines the across-flats size of the nut body.
The integrated flange is positioned at one end of the nut body and is defined by flange_diameter and flange_thickness, forming a widened bearing surface.
The central plain through-hole runs through the full height of the nut and is defined by inner_diameter.
Key parameters:
overall_height = 16 mm
flange_diameter = 34.5 mm
flange_thickness = 7 mm
hub_width = 24 mm
inner_diameter = 16 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.