A long slotted aluminum extrusion has a constant cross-section centered on perpendicular X and Y datum axes and extends along its...
harbor run -t gnucleus-ai/freecad-58d768db95harbor download gnucleus-ai/freecad-58d768db95Write a FreeCAD Python script to /app/answer.py that reproduces the
part described below.
FreeCAD version: 1.1.0.
Part description:
A long slotted aluminum extrusion has a constant cross-section centered on perpendicular X and Y datum axes and extends along its longitudinal axis from extrusion_axis_start_offset for extrusion_length. The cross-section is mirror-symmetric about both datum axes and has a rounded rectangular envelope, six re-entrant perimeter T-slots, four corner screw ports, a central polygonal channel, and two closed lobed internal relief channels.
The envelope uses cross_section_half_width and cross_section_half_height with tangent quarter-round corners of perimeter_corner_fillet_arc_radius. Four equal screw ports of corner_screw_port_diameter are centered at the positive and negative combinations of the listed X and Y offsets.
The central channel is symmetric about both axes. Its vertical sides lie at central_channel_half_width and span a centered waist of t_slot_opening_width. On the lower half, central_channel_transition_x_offset_1 and central_channel_transition_x_offset_4 lie at the waist level; diagonal sides descend to central_channel_transition_x_offset_2 and central_channel_transition_x_offset_3 at central_channel_half_height, with a horizontal edge between them. Mirror this chain across the X axis.
One T-slot is centered on each short side, and two are centered at positive and negative cross_section_half_width on each long side. Every outer mouth has t_slot_opening_width and uses profile_wall_step for its lips and neck.
For the right half of the top seed slot, start at the positive mouth edge. Step inward by profile_wall_step, continue to four profile_wall_step below the outer face, and widen to the station given by central_channel_half_width less half the mouth width. Continue to t_slot_boundary_step_value_12, return diagonally to t_slot_boundary_step_value_4 at the level set by cross_section_half_height less central_channel_half_height, then narrow to a profile_wall_step half-neck and a centered apex one profile_wall_step farther inward. Mirror this chain across the Y axis for the complete top slot.
For the upper-right seed slot, the mouth is centered at positive cross_section_half_width on the right outer face. Its upper return begins at central_channel_half_width and the level set by cross_section_half_height less half central_channel_half_width, then runs through t_slot_boundary_step_value_5 and diagonally to the neck at t_slot_boundary_step_value_10. The lower return runs from the neck at t_slot_boundary_step_value_9 diagonally through t_slot_boundary_step_value_8 at half central_channel_half_width, then reaches central_channel_half_width. The neck side is half central_channel_half_width less profile_wall_step; its nose is one further profile_wall_step inward and spans one profile_wall_step above and below the slot center. Reflect this seed across the X axis for the lower-right slot and across the Y axis for the left pair.
Separate from the perimeter T-slots, the upper internal relief is a closed four-lobed channel centered on the Y axis at positive cross_section_half_width. Its top, left, bottom, and right lobes use t_slot_primary_arc_radius and the listed lobe angles. Smaller t_slot_fillet_radius arcs occupy the four diagonal corners at the listed left/right X and upper/lower Y center offsets. Their spans are inset from the quadrant boundaries by t_slot_fillet_angle_increment, and short tangent segments complete the boundary. The lower channel mirrors this profile across the X axis using the listed lower Y offsets. All ports and channels continue through the full extrusion length.
Key parameters:
extrusion_length = 1040.0 mm
extrusion_axis_start_offset = -520.0 mm
cross_section_half_width = 15.0 mm
cross_section_half_height = 30.0 mm
number_of_t_slots = 6
t_slot_opening_width = 9.0 mm
t_slot_lobed_arc_angle_1 = 54.1331978 degrees
t_slot_lobed_arc_angle_2 = 125.8668022 degrees
t_slot_lobed_arc_angle_3 = 144.1331978 degrees
t_slot_lobed_arc_angle_4 = -144.1331978 degrees
t_slot_lobed_arc_angle_5 = -125.8668022 degrees
t_slot_lobed_arc_angle_6 = -54.1331978 degrees
t_slot_lobed_arc_angle_7 = -35.8668022 degrees
t_slot_lobed_arc_angle_8 = 35.8668022 degrees
t_slot_lobed_arc_center_offset_1 = -3.43 mm
t_slot_lobed_arc_center_offset_2 = 18.43 mm
t_slot_lobed_arc_center_offset_3 = 11.57 mm
t_slot_lobed_arc_center_offset_4 = 3.43 mm
t_slot_lobed_arc_center_offset_5 = -18.43 mm
t_slot_lobed_arc_center_offset_6 = -11.57 mm
t_slot_primary_arc_radius = 3.15 mm
t_slot_fillet_radius = 1.0 mm
profile_wall_step = 0.5 mm
t_slot_fillet_angle_increment = 15.0 degrees
t_slot_boundary_step_value_1 = -29.5 mm
t_slot_boundary_step_value_2 = -24.91 mm
t_slot_boundary_step_value_3 = -4.59 mm
t_slot_boundary_step_value_4 = 4.59 mm
t_slot_boundary_step_value_5 = 9.91 mm
t_slot_boundary_step_value_6 = -19.59 mm
t_slot_boundary_step_value_7 = -10.27 mm
t_slot_boundary_step_value_8 = 9.77 mm
t_slot_boundary_step_value_9 = 10.27 mm
t_slot_boundary_step_value_10 = 19.59 mm
t_slot_boundary_step_value_11 = 29.5 mm
t_slot_boundary_step_value_12 = 24.91 mm
t_slot_boundary_step_value_13 = -9.91 mm
t_slot_boundary_step_value_14 = -9.77 mm
central_channel_half_width = 13.0 mm
central_channel_half_height = 9.0 mm
central_channel_transition_x_offset_1 = -9.23 mm
central_channel_transition_x_offset_2 = -4.73 mm
central_channel_transition_x_offset_3 = 4.73 mm
central_channel_transition_x_offset_4 = 9.23 mm
corner_screw_port_diameter = 4.2 mm
number_of_corner_screw_ports = 4
corner_screw_port_center_x_offset = 11.5 mm
corner_screw_port_center_y_offset = 26.5 mm
perimeter_corner_fillet_arc_radius = 1.5 mm
perimeter_corner_fillet_central_angle = 90.0 degrees
The script must build the model 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 resulting FCStd must contain named document objects whose properties drive the geometry, not a single Part::Feature holding a pre-computed TopoShape.
The grader will run freecadcmd /app/answer.py and then read both
/app/answer.py and /app/answer.FCStd for scoring. Your script
must save the FreeCAD document to /app/answer.FCStd before exiting
— e.g. doc.saveAs("/app/answer.FCStd") after doc.recompute(). The
grader does not save the document on your behalf; if
/app/answer.FCStd does not exist when freecadcmd returns, the
reward is 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.
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.