A circular flange with an integral solid stepped hub is axisymmetric about its part axis except for the evenly spaced mounting holes. Axial...
harbor run -t gnucleus-ai/freecad-8c88cd424aharbor download gnucleus-ai/freecad-8c88cd424aWrite a FreeCAD Python script to /app/answer.py that produces the
edited part described below.
This is a two-step task. First, build the base part from its description
and parameters. Then apply the edit instruction to that base to produce
the target part. Both .FCStd files are graded — the base and the
target — so the script must emit both, and each must be built through
editable PartDesign features (not a baked compound).
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 two .FCStd files next to the script:
<script_stem>_base.FCStd — the base part before the edit<script_stem>_edit.FCStd — the target part after the edit is appliedBoth output paths must be derived from __file__ at runtime; do not
hardcode them or rely on the current working directory. Only the two
files written next to the executing script are graded.
FreeCAD version: 1.1.0.
Base part description:
A circular flange has an integral solid stepped hub and is axisymmetric about its part axis. The raised front land blends into the flange front face through two tangent equal-radius arcs. The flange plate uses flange_outer_diameter and flange_plate_thickness, with a rounded outer front edge and equal-leg chamfer at the back edge. A rounded back transition leads through a cylindrical shoulder to the main hub, which narrows through shared-radius rounds to a waist and opens again into a rounded rear rim. The base does not yet include the bolt-circle mounting holes.
Base part key parameters:
Edit instruction:
Add number_of_bolt_holes identical circular holes of bolt_hole_diameter through the full flange plate. Place their centers on a circle of flange_bolt_circle_diameter concentric with the retained part axis and space them evenly through a full turn. Keep the axisymmetric flange, solid stepped hub, all transition geometry, and every retained dimension unchanged.
Target key parameters:
Scope: Solve only the CAD task described above. Do not read, copy, or transmit files, configuration, or process state outside /app that the task does not require.