A single-port angled connector housing transitions from a rounded-square rear section to one coaxial circular port. It has a centered...
harbor run -t gnucleus-ai/freecad-a9d339604fharbor download gnucleus-ai/freecad-a9d339604fWrite a FreeCAD Python script to /app/answer.py that reproduces the
part described below.
FreeCAD version: 1.1.0.
Part description:
A single-port angled connector housing transitions from a rounded-square rear section to one coaxial circular port. It has a centered opening at the circular end, two distinct side openings, paired side fastener holes with counterbores, and a four-corner through-hole and counterbore arrangement.
The rear section thickness is rear_rounded_square_section_thickness. Its profile has rounded_square_side_count identical sides. Each side uses a straight segment of rounded_square_flat_edge_length and a non-tangent corner arc governed by rounded_square_corner_arc_radius, rounded_square_corner_arc_start_angle, and rounded_square_corner_arc_end_angle. The equal-magnitude corner-center offsets from the profile center are rounded_square_corner_center_offset, and the signed offset of the lower straight segment from the profile center is rounded_square_lower_flat_offset_from_center.
The circular end has circular_port_outer_diameter and is coaxial with the rear rounded-square profile. The axial distance from the rear datum plane to the circular end plane is housing_overall_axial_length.
The circular-end opening is centered on the port axis and is governed by circular_end_opening_width and circular_end_opening_height. A separate lower side opening is governed by lower_side_opening_width and lower_side_opening_height; its center is located from the side-face center datum by lower_side_opening_center_x_offset and lower_side_opening_center_y_offset, using the face-local rightward and upward positive directions. The tapered side opening is centered transversely, starts at the rear-section boundary, and is governed by tapered_side_opening_near_edge_height, tapered_side_opening_far_edge_height, and tapered_side_opening_axial_length. The circular-end opening and both side openings pass completely through their respective housing walls.
A paired side fastener row is centered about the side-face midline. Its axial station and center spacing are side_fastener_row_axial_position and side_fastener_center_spacing. Each fastener has side_fastener_through_hole_diameter and a coaxial counterbore governed by side_fastener_counterbore_diameter and side_fastener_counterbore_depth.
At the four rounded-square corner-arc centers, corner_fastener_count coaxial fasteners are distributed with the same rotational phase as the rear profile. Their through holes are governed by corner_through_hole_diameter and corner_through_hole_depth, and their counterbores by corner_counterbore_diameter and corner_counterbore_depth.
Key parameters:
rear_rounded_square_section_thickness = 10.0 mm
rounded_square_side_count = 4
rounded_square_corner_center_offset = 31.8198052 mm
rounded_square_corner_arc_radius = 7.5 mm
rounded_square_corner_arc_start_angle = 131.8103149 degrees
rounded_square_corner_arc_end_angle = -41.8103149 degrees
rounded_square_flat_edge_length = 52.4592704 mm
rounded_square_lower_flat_offset_from_center = -36.8198052 mm
circular_port_outer_diameter = 60.0 mm
housing_overall_axial_length = 52.52 mm
circular_end_opening_width = 24.5 mm
circular_end_opening_height = 31.5 mm
lower_side_opening_width = 24.05 mm
lower_side_opening_height = 30.0 mm
lower_side_opening_center_x_offset = -0.225 mm
lower_side_opening_center_y_offset = -28.0 mm
tapered_side_opening_near_edge_height = 30.0 mm
tapered_side_opening_far_edge_height = 25.0 mm
tapered_side_opening_axial_length = 15.0 mm
side_fastener_row_axial_position = 34.52 mm
side_fastener_center_spacing = 24.0 mm
side_fastener_through_hole_diameter = 3.7 mm
side_fastener_counterbore_diameter = 7.0 mm
side_fastener_counterbore_depth = 21.0 mm
corner_fastener_count = 4
corner_through_hole_diameter = 5.0 mm
corner_through_hole_depth = 22.6 mm
corner_counterbore_diameter = 8.5 mm
corner_counterbore_depth = 12.52 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.