A connecting rod consists of a flat plate with two circular heads connected by a straight shaft, and a through-hole at each head. The...
Run
harbor run -t gnucleus-ai/freecad-da772a2e0b
Download
harbor download gnucleus-ai/freecad-da772a2e0b
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 connecting rod consists of a flat plate with two circular heads connected by a straight shaft, and a through-hole at each head.
The overall thickness of the rod is controlled by plate_thickness. The two heads are sized by head_outer_diameter and connected by a shaft whose width is set by shaft_width. The head-to-head spacing is defined by hole_center_distance. Each head contains a through-hole sized by hole_diameter, centered on the head.
Key parameters:
plate_thickness = 3.0 mm
hole_center_distance = 29.0 mm
head_outer_diameter = 7.0 mm
hole_diameter = 3.0 mm
shaft_width = 3.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.