@@ -2414,8 +2414,8 @@ module platform_transverse_angle(length) {
24142414 }
24152415
24162416 // Deck Mounting Holes (Vertical through Horizontal Leg)
2417- // 2 bolts: Near ends (aligned with side rails)
2418- for (x_pos = [- length/2 + PLATFORM_TRANSVERSE_BOLT_END_OFFSET, length/2 - PLATFORM_TRANSVERSE_BOLT_END_OFFSET]) {
2417+ // 3 bolts: Near ends and Center
2418+ for (x_pos = [- length/2 + PLATFORM_TRANSVERSE_BOLT_END_OFFSET, 0 , length/2 - PLATFORM_TRANSVERSE_BOLT_END_OFFSET]) {
24192419 translate ([x_pos, leg/2 , 0 ])
24202420 cylinder (d= angle_bolt_hole_dia, h= thick* 3 , center= true , $ fn= 24 );
24212421 }
@@ -2443,19 +2443,109 @@ module platform_angle_iron(length=0, is_side=false) {
24432443 // Pivot Holes (Start) - Horizontal Holes through Vertical Leg (Leg 1)
24442444 // Leg 1 is along X. Normal Y. Holes along Y.
24452445 // 2 holes for bolts into the L shaped pivot plate
2446- // Positions: PLATFORM_SIDE_BOLT_START and + SPACING
2447- for (z_pos = [PLATFORM_SIDE_BOLT_START, PLATFORM_SIDE_BOLT_START + PLATFORM_SIDE_BOLT_SPACING]) {
2448- translate ([PLATFORM_ANGLE_LEG/2 , PLATFORM_ANGLE_THICK/2 , z_pos])
2449- rotate ([90 , 0 , 0 ]) // Align with Y axis
2446+
2447+ // Replicate calculations to align with platform_pivot_bracket
2448+
2449+ // 1. Calculate side_angle_start_y (World Y of Angle Iron Start)
2450+ // From assembly:
2451+ deck_pivot_y = PLATFORM_BRACKET_WIDTH/2 ;
2452+ front_angle_corner_y = deck_pivot_y - PLATFORM_EDGE_MARGIN - PLATFORM_ANGLE_LEG;
2453+ gap = 12.7 ;
2454+ side_angle_start_y = front_angle_corner_y - gap;
2455+
2456+ // 2. Calculate bolt positions
2457+ // Bracket bolts are on Leg 2 (File X -> Assembly -Y).
2458+ // Bracket Y is constant `bolt_y`.
2459+ // Bracket X varies: bolt_x_1, bolt_x_2.
2460+
2461+ corner_y = - PLATFORM_LOCK_OFFSET + PLATFORM_SIDE_BOLT_Y_OFFSET;
2462+ bracket_width = PLATFORM_BRACKET_WIDTH;
2463+ leg2_length = PLATFORM_BRACKET_LENGTH - bracket_width/2 ;
2464+ bx_1 = pivot_bolt_offset;
2465+ bx_2 = leg2_length - pivot_bolt_offset;
2466+
2467+ // 3. Map to Angle Iron Coordinates
2468+ // Angle Iron Local Z (Longitudinal) corresponds to Assembly -Y.
2469+ // Angle Iron Local X (Leg 1) corresponds to Assembly Z.
2470+
2471+ // Longitudinal Position (z_pos)
2472+ // Matches Bracket X (bx).
2473+ // z_pos = bx.
2474+ // Wait. Bracket X is distance from Pivot (along Leg 2).
2475+ // Angle Iron Z is distance from Angle Start.
2476+ // Angle Start is at side_angle_start_y.
2477+ // Pivot is at 0 (in Y).
2478+ // But Angle Iron is translated by side_angle_z_trans.
2479+ // side_angle_z_trans = PLATFORM_LOCK_OFFSET - side_angle_start_y.
2480+ // This is confusing.
2481+ // Let's use the fact that Bracket X=0 is at Corner.
2482+ // Corner is at Y = corner_y (in Bracket Local Y).
2483+ // But Bracket Leg 2 starts at X=0.
2484+ // In Assembly, Bracket Leg 2 starts at Pivot Y? No.
2485+ // Bracket Leg 2 starts at Corner Y?
2486+ // Bracket Leg 2 is the Horizontal Leg.
2487+ // It extends from Corner (Y=-130) backwards?
2488+ // No, Bracket Leg 2 is along Local X.
2489+ // Local X maps to World -Y.
2490+ // So it extends from Y=0 (Pivot) to Y=-Length?
2491+ // No, Bracket Local X=0 is at Pivot Y?
2492+ // In `platform_pivot_bracket`, X=0 is at Pivot X.
2493+ // So Bracket Leg 2 starts at Pivot X (which is 0).
2494+ // So Bracket X is distance from Pivot.
2495+ // So bx is distance from Pivot.
2496+
2497+ // Angle Iron Start is at side_angle_start_y (World Y).
2498+ // Angle Iron extends along -Y.
2499+ // So Angle Iron Z=0 is at side_angle_start_y.
2500+ // Angle Iron Z=z_pos is at Y = side_angle_start_y - z_pos.
2501+ // We want Y = -bx (since Bracket X maps to -Y).
2502+ // side_angle_start_y - z_pos = -bx.
2503+ // z_pos = side_angle_start_y + bx.
2504+
2505+ z_pos_1 = side_angle_start_y + bx_1;
2506+ z_pos_2 = side_angle_start_y + bx_2;
2507+
2508+ // Vertical Position (x_pos on profile)
2509+ // Matches Bracket Y (bolt_y).
2510+ // Bracket Y maps to World Z.
2511+ // Angle Iron X maps to World Z? No.
2512+ // Angle Iron Local X (Leg 1) -> Frame -Y -> World -Z.
2513+ // Angle Iron Local Y (Leg 2) -> Frame X -> World X.
2514+ // Angle Iron Local Z -> Frame Z -> World -Y.
2515+
2516+ // Wait. If Angle Iron Local X -> World -Z.
2517+ // Then Angle Iron X is Vertical (Down).
2518+ // Bracket Y is Vertical (Up/Down).
2519+ // Bracket Y = corner_y - width/2 + LEG/2.
2520+ // This is a negative value (e.g. -155).
2521+ // Angle Iron Origin Z is PLATFORM_ANGLE_Z_OFFSET.
2522+ // Angle Iron X is distance DOWN from Origin.
2523+ // World Z = Origin Z - Angle_X.
2524+ // Angle_X = Origin Z - World Z.
2525+ // Angle_X = PLATFORM_ANGLE_Z_OFFSET - bolt_y.
2526+
2527+ // Substitute PLATFORM_ANGLE_Z_OFFSET = corner_y - width/2 + LEG.
2528+ // Substitute bolt_y = corner_y - width/2 + LEG/2.
2529+ // Angle_X = (corner_y - width/2 + LEG) - (corner_y - width/2 + LEG/2).
2530+ // Angle_X = LEG - LEG/2 = LEG/2.
2531+
2532+ x_pos = PLATFORM_ANGLE_LEG/2 ;
2533+
2534+ for (z_pos = [z_pos_1, z_pos_2]) {
2535+ translate ([x_pos, PLATFORM_ANGLE_THICK/2 , z_pos])
2536+ rotate ([0 , 90 , 0 ]) // Align with X axis
24502537 cylinder (d= angle_bolt_hole_dia, h= PLATFORM_ANGLE_THICK + 10 , center= true , $ fn= 24 );
24512538 }
24522539
24532540 // Deck Holes (Middle) - Vertical Holes through Horizontal Leg (Leg 2)
24542541 // Leg 2 is along Y. Normal X. Holes along X.
24552542 // 2 bolts upward connecting to the platform itself
2456- // Centered on length
2457- center_z = height / 2 ;
2458- for (z_pos = [center_z - PLATFORM_SIDE_DECK_BOLT_SPACING/2 , center_z + PLATFORM_SIDE_DECK_BOLT_SPACING/2 ]) {
2543+ // Symmetrical from end to end
2544+ // Offset from ends: PLATFORM_SIDE_DECK_BOLT_END_OFFSET
2545+ // If not defined, use 1/4 length or similar.
2546+ // Let's use a fixed offset from ends.
2547+ deck_bolt_offset = 50 ; // 50mm from ends
2548+ for (z_pos = [deck_bolt_offset, height - deck_bolt_offset]) {
24592549 translate ([PLATFORM_ANGLE_THICK/2 , PLATFORM_ANGLE_LEG/2 , z_pos])
24602550 rotate ([0 , 90 , 0 ]) // Align with X axis
24612551 cylinder (d= angle_bolt_hole_dia, h= PLATFORM_ANGLE_THICK + 10 , center= true , $ fn= 24 );
@@ -2464,13 +2554,9 @@ module platform_angle_iron(length=0, is_side=false) {
24642554 // Transverse Angle Iron
24652555 // Deck Holes only
24662556 // 2 bolts: Near ends
2467- center_z = height / 2 ;
24682557 // Note: Transverse angle iron logic is handled by platform_transverse_angle module above
24692558 // This else block might be unused if platform_transverse_angle is used instead
24702559 // But if it IS used, we should update it too.
2471- // However, the assembly calls platform_transverse_angle for transverse angles.
2472- // So this block is likely dead code or for a different configuration.
2473- // I will leave it as is or update it to match just in case.
24742560 for (z_pos = [PLATFORM_TRANSVERSE_BOLT_END_OFFSET, height - PLATFORM_TRANSVERSE_BOLT_END_OFFSET]) {
24752561 translate ([PLATFORM_ANGLE_THICK/2 , PLATFORM_ANGLE_LEG/2 , z_pos])
24762562 rotate ([0 , 90 , 0 ]) // Align with X axis
@@ -2504,8 +2590,8 @@ module folding_platform_assembly(fold_angle=90) {
25042590 // Bracket Thickness is assumed to be PLATE_1_4_INCH (6.35mm).
25052591 // Angle Iron Vertical Leg (Outer Face) should be at Bracket Inner Face.
25062592 // Bracket Inner Face X = PLATFORM_PIVOT_X - PLATE_1_4_INCH/2.
2507- // So Angle Iron X = PLATFORM_PIVOT_X - 3.175 .
2508- angle_iron_x_from_center = PLATFORM_PIVOT_X - 3.175 ;
2593+ // So Angle Iron X = PLATFORM_PIVOT_X - PLATFORM_SIDE_GAP .
2594+ angle_iron_x_from_center = PLATFORM_PIVOT_X - PLATFORM_SIDE_GAP ;
25092595
25102596 // Shift platform forward by 0.5 inches (12.7mm)
25112597 shift_y = 0 ;
@@ -2748,7 +2834,7 @@ module folding_platform_assembly(fold_angle=90) {
27482834 color ("DarkSlateGray" )
27492835 translate ([bracket_x, pivot_y, pivot_z])
27502836 rotate ([fold_angle, 0 , 0 ])
2751- rotate ([0 , - 90 , 0 ])
2837+ rotate ([0 , - 90 , 0 ]) // Reverted rotation: X->Z (Up), Y->Y (Back), Z->-X (Side)
27522838 linear_extrude(height= PLATFORM_THICKNESS, center= true )
27532839 projection(cut= true )
27542840 platform_pivot_bracket();
0 commit comments