A four-outlet power-strip socket block consists of a thin rectangular base plate, a raised continuous outer wall, a raised stepped inner...
harbor run -t gnucleus-ai/freecad-0a7d0da980harbor download gnucleus-ai/freecad-0a7d0da980Write a FreeCAD Python script to /app/answer.py that reproduces the
part described below.
FreeCAD version: 1.1.0.
Part description:
A four-outlet power-strip socket block consists of a thin rectangular base plate, a raised continuous outer wall, a raised stepped inner wall, two long reinforcing ribs, and four repeated socket openings. Each opening contains nested outer and inner boundaries plus three small rectangular contact recesses.
In plan view, X spans the short block dimension and the socket modules run along Y. The base starts at base_x_min and base_y_min on the global XY plane, has block_length by block_width, and rises in +Z by block_thickness.
The outer wall starts on the base top and rises in +Z by block_extrude_depth. Its closed plan contour occupies outer_profile_left_side_x through outer_profile_right_side_x and outer_profile_bottom_y through outer_profile_top_y, with a horizontal top span from top_edge_left_x to top_edge_right_x. All outer-wall arc angles are measured counterclockwise from +X, and each named start/end pair follows the shorter exterior sweep. Two independently dimensioned terminal arcs and straight shoulders form the upper end. One inter-socket transition seed contains an upper and lower arc on each side; exactly two straight segments join each pair at the corresponding transition_seed elbow. The second and third transitions are copies of this seed shifted by one and two socket_module_pitch intervals toward decreasing Y. Single straight side segments connect adjacent terminal, transition, and bottom-arc endpoints. Independently dimensioned bottom connecting arcs join bottom_straight_span to close the lower end. A line/arc join is tangent only where their specified directions coincide.
The stepped inner wall begins on the outer-wall top and rises in +Z by stepped_profile_extrude_depth. It is centered at stepped_profile_center_x, extends from stepped_profile_top_y to stepped_profile_bottom_y, and remains within the cavity_profile_overall_width by cavity_profile_overall_height envelope. Its left and right paths are intentionally independent. From the right end of stepped_top_flat_width, the top boundary proceeds through the top-center right fillet, top_right_shoulder_length shoulder, top-right corner fillet, and right outer run; the two fillets share the shoulder tangent controlled by top_right_corner_arc_angle. The left end follows the analogous sequence using top_center_left_arc_radius, top_left_shoulder_length, top_left_corner_arc_radius, and top_center_left_arc_angle. Each side then descends through upper, middle, and lower groups in the order outer run, step fillet, horizontal ledge, inner run, and diagonal return, using the corresponding side-specific lengths, radii, and angles. Transition and bottom-bevel angles are unsigned acute inclinations from horizontal; the side and traversal direction determine their signs. Smooth step arcs are tangent to adjoining segments except the original upper-right step junction, whose non-tangent span is set by upper_step_right_arc_angle. After each lower diagonal, bottom_outer_vertical_right_length or bottom_outer_vertical_left_length reaches the bottom closure, followed by the corresponding outer ledge and bevel into bottom_flat_width.
Two parallel reinforcing ribs run along Y on the stepped inner wall. Each has stepped_rib_width, stepped_rib_length, and stepped_rib_height. Their lower ends are at rib_y_min, their X minima are rib_left_x_min and rib_right_x_min, and their centerlines are separated by gap_between_ribs.
The four socket openings share one nested dual-wall seed and are spaced along +Y by socket_module_pitch. For each outer or inner boundary, the top segment lies at its named seed_socket top Y level, its right endpoint is the corresponding seed_socket top_right_x, and it extends left by the corresponding profile_top_width. On the right side, the top fillet is tangent to the top segment and a descending exterior shoulder; the upper fillet is tangent to that shoulder and the vertical at seed_socket_right_x; and the lower fillet is tangent to that vertical and the bottom segment at seed_socket_bottom_y. The named right straight length fixes the vertical portion. The left side follows the same topology with its left extent, straight length, and side-specific radii. Each shoulder uses the convex exterior common-tangent branch, and the bottom segment joins the two lower fillets directly. All twelve seed arcs are tangent fillets. The complete outer/inner boundary pair begins at socket_profile_cut_start_z, extends in +Z by stepped_cavity_cut_depth, and repeats three more times along +Y.
Each module also contains number_of_small_cavities equal rectangular recesses of small_cavity_length by small_cavity_width. The left and right seed recesses share the lower Y level and the center recess is above them, with positions given by the corresponding x_min and y_min parameters. The three-recess seed begins at small_cavity_cut_start_z, extends in +Z by cavity_cutout_depth, and repeats with the socket boundary pair along +Y.
Key parameters:
block_length = 34.75 mm
block_width = 98.6 mm
block_thickness = 3.2 mm
base_x_min = -17.38 mm
base_y_min = -96.79 mm
block_extrude_depth = 17.46 mm
profile_overall_length = 94.99 mm
outer_profile_top_y = -0.05 mm
outer_profile_bottom_y = -95.04 mm
outer_profile_left_side_x = -15.92 mm
outer_profile_right_side_x = 15.9 mm
top_edge_width = 19.87 mm
top_edge_left_x = -9.99 mm
top_edge_right_x = 9.88 mm
top_terminal_arc_left_center_x = -10.05 mm
top_terminal_arc_left_center_y = -8.36 mm
top_terminal_arc_left_radius = 5.85 mm
top_terminal_arc_left_start_angle = 140.1317284 degrees
top_terminal_arc_left_end_angle = -179.9020586 degrees
top_terminal_arc_right_center_x = 9.95 mm
top_terminal_arc_right_center_y = -8.56 mm
top_terminal_arc_right_radius = 5.94 mm
top_terminal_arc_right_start_angle = 2.217415716 degrees
top_terminal_arc_right_end_angle = 41.38540326 degrees
transition_seed_upper_left_arc_center_x = -10.14 mm
transition_seed_upper_left_arc_center_y = -17.59 mm
transition_seed_upper_left_arc_radius = 5.74 mm
transition_seed_upper_left_arc_start_angle = -179.7005474 degrees
transition_seed_upper_left_arc_end_angle = -107.6458007 degrees
transition_seed_upper_right_arc_center_x = 10.08 mm
transition_seed_upper_right_arc_center_y = -17.74 mm
transition_seed_upper_right_arc_radius = 5.81 mm
transition_seed_upper_right_arc_start_angle = -71.1286391 degrees
transition_seed_upper_right_arc_end_angle = -3.748504046 degrees
transition_seed_lower_left_arc_center_x = -10.05 mm
transition_seed_lower_left_arc_center_y = -32.23 mm
transition_seed_lower_left_arc_radius = 5.82 mm
transition_seed_lower_left_arc_start_angle = 134.2342454 degrees
transition_seed_lower_left_arc_end_angle = -180.0984463 degrees
transition_seed_lower_right_arc_center_x = 10.41 mm
transition_seed_lower_right_arc_center_y = -32.12 mm
transition_seed_lower_right_arc_radius = 5.46 mm
transition_seed_lower_right_arc_start_angle = 0.2098737116 degrees
transition_seed_lower_right_arc_end_angle = 46.18730732 degrees
transition_seed_left_elbow_x = -11.91 mm
transition_seed_left_elbow_y = -25.85 mm
transition_seed_right_elbow_x = 11.97 mm
transition_seed_right_elbow_y = -26.0 mm
number_of_inter_socket_transitions = 3
bottom_connecting_arc_left_center_x = -10.87 mm
bottom_connecting_arc_left_center_y = -89.98 mm
bottom_connecting_arc_left_radius = 5.05 mm
bottom_connecting_arc_left_start_angle = -180 degrees
bottom_connecting_arc_left_end_angle = -90 degrees
bottom_connecting_arc_right_center_x = 10.74 mm
bottom_connecting_arc_right_center_y = -89.88 mm
bottom_connecting_arc_right_radius = 5.16 mm
bottom_connecting_arc_right_start_angle = -90 degrees
bottom_connecting_arc_right_end_angle = 0 degrees
bottom_straight_span = 21.61 mm
stepped_profile_extrude_depth = 3.73 mm
top_right_corner_arc_radius = 2.43 mm
top_right_corner_arc_angle = 45.7064486 degrees
top_center_right_arc_radius = 1.7 mm
top_center_left_arc_radius = 2.04 mm
top_center_left_arc_angle = 44.6468796 degrees
top_left_corner_arc_radius = 2.08 mm
upper_step_right_arc_radius = 1.49 mm
upper_step_right_arc_angle = 85.4445613 degrees
upper_step_left_arc_radius = 1.42 mm
middle_step_left_arc_radius = 1.24 mm
middle_step_right_arc_radius = 1.48 mm
lower_step_left_arc_radius = 1.3 mm
lower_step_right_arc_radius = 1.55 mm
stepped_top_flat_width = 11.23 mm
upper_transition_right_diagonal_angle = 45.1223816 degrees
upper_transition_left_diagonal_angle = 45.8308042 degrees
middle_transition_right_diagonal_angle = 44.1045136 degrees
middle_transition_left_diagonal_angle = 51.9153345 degrees
lower_transition_right_diagonal_angle = 50.3628164 degrees
lower_transition_left_diagonal_angle = 50.2924765 degrees
bottom_right_bevel_angle = 36.6341139 degrees
bottom_left_bevel_angle = 42.4362298 degrees
top_right_shoulder_length = 5.6 mm
top_left_shoulder_length = 5.59 mm
upper_outer_vertical_right_length = 8.12 mm
upper_outer_vertical_left_length = 8.21 mm
upper_horizontal_ledge_right_length = 0.78 mm
upper_horizontal_ledge_left_length = 0.79 mm
upper_inner_vertical_right_length = 11.33 mm
upper_inner_vertical_left_length = 11.27 mm
upper_transition_right_diagonal_length = 3.2 mm
upper_transition_left_diagonal_length = 3.27 mm
middle_outer_vertical_right_length = 8.96 mm
middle_outer_vertical_left_length = 9.18 mm
middle_horizontal_ledge_right_length = 0.72 mm
middle_horizontal_ledge_left_length = 1.05 mm
middle_inner_vertical_right_length = 11.39 mm
middle_inner_vertical_left_length = 10.9 mm
middle_transition_right_diagonal_length = 3.06 mm
middle_transition_left_diagonal_length = 3.7 mm
lower_outer_vertical_right_length = 8.98 mm
lower_outer_vertical_left_length = 8.91 mm
lower_horizontal_ledge_right_length = 0.68 mm
lower_horizontal_ledge_left_length = 0.99 mm
lower_inner_vertical_right_length = 11.07 mm
lower_inner_vertical_left_length = 11.01 mm
lower_transition_right_diagonal_length = 3.49 mm
lower_transition_left_diagonal_length = 3.59 mm
bottom_outer_vertical_right_length = 10.31 mm
bottom_outer_vertical_left_length = 10.31 mm
bottom_outer_ledge_right_length = 4.9 mm
bottom_outer_ledge_left_length = 4.98 mm
bottom_right_bevel_length = 0.48 mm
bottom_left_bevel_length = 0.48 mm
cavity_profile_overall_width = 23.19 mm
cavity_profile_overall_height = 87.78 mm
bottom_flat_width = 12.5 mm
stepped_profile_center_x = 0.0 mm
stepped_profile_top_y = -3.58 mm
stepped_profile_bottom_y = -91.36 mm
stepped_rib_width = 1.6 mm
stepped_rib_length = 86.7 mm
stepped_rib_height = 3.2 mm
gap_between_ribs = 7.0 mm
number_of_ribs = 2
rib_left_x_min = -4.31 mm
rib_right_x_min = 2.69 mm
rib_y_min = -90.88 mm
stepped_cavity_cut_depth = 18.5 mm
socket_profile_cut_start_z = 0.0 mm
outer_profile_top_width = 12.87 mm
inner_profile_top_width = 10.15 mm
seed_socket_outer_top_right_x = 6.54 mm
seed_socket_inner_top_right_x = 5.12 mm
outer_right_straight_length = 7.62 mm
outer_left_straight_length = 7.63 mm
inner_right_straight_length = 6.06 mm
inner_left_straight_length = 5.81 mm
outer_top_right_arc_radius = 6.29 mm
outer_upper_right_arc_radius = 6.59 mm
outer_lower_right_arc_radius = 5.91 mm
outer_lower_left_arc_radius = 5.99 mm
outer_upper_left_arc_radius = 6.42 mm
outer_top_left_arc_radius = 6.77 mm
inner_top_right_arc_radius = 2.99 mm
inner_top_left_arc_radius = 3.26 mm
inner_upper_left_arc_radius = 3.76 mm
inner_lower_left_arc_radius = 3.46 mm
inner_lower_right_arc_radius = 3.3 mm
inner_upper_right_arc_radius = 3.02 mm
seed_socket_outer_left_x = -14.93 mm
seed_socket_outer_right_x = 14.93 mm
seed_socket_outer_top_y = -72.6 mm
seed_socket_outer_bottom_y = -94.68 mm
seed_socket_inner_left_x = -11.14 mm
seed_socket_inner_right_x = 11.28 mm
seed_socket_inner_top_y = -75.9 mm
seed_socket_inner_bottom_y = -91.27 mm
small_cavity_length = 2.47 mm
small_cavity_width = 5.0 mm
cavity_cutout_depth = 8.0 mm
small_cavity_cut_start_z = 0.0 mm
number_of_small_cavities = 3
right_cavity_x_min = 5.79 mm
right_cavity_y_min = -88.15 mm
center_cavity_x_min = -1.19 mm
center_cavity_y_min = -84.04 mm
left_cavity_x_min = -8.2 mm
left_cavity_y_min = -88.15 mm
number_of_socket_modules = 4
socket_module_pitch = 24.0 mm
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.