xy_delta = ((bushing_xy[1] <= 7.7) ? 0 : bushing_xy[1] - 7.7) * 0.9;
// fixme: this seems useless now but ... ?
+// fixme: might need something (this is it?) to compensate for x_box_width increasing with size of bearing
z_delta = 0; //(bushing_z[1] <= 7.7) ? 0 : bushing_z[1] - 7.7;
m3_nut_diameter_bigger = ((m3_nut_diameter / 2) / cos (180 / 6)) * 2;
zaxis_delta_y = (frame_type == frame_alu) ? -5 : 0;
// shift motor/leadscrew mount to clear bearings and x-rods
-// X/Y ARE SWITCHED FROM X-END CONFIGURATION BE WARNED
-// BONUS FUN: X (Y in x-end configuration) IS INVERTED!
-// fixed, but it was all a fucking tautology in the end whoops
+// this is the model local coordinate space for the Z axis, so:
+// Y controls the extra distance between the motor and smooth rod, and
+// X controls the extra distance between the motor and the frame
+// TODO: auto calculate based on bearing (and leadscrew nut?) sizes
zmotor_delta_x = ((frame_type == frame_alu) && (bushing_z[1] > 9)) ? 3 : 0;
zmotor_delta_y = ((frame_type == frame_alu) && (bushing_xy[0] >= 5)) ? 5 : 0;
// Bearing holder
vertical_bushing_base(bushing_z);
//Nut trap
- translate(v=[-4-zmotor_delta_y,-17-zmotor_delta_x,4]) nut_trap_base ();
+ translate(v=[-4+zmotor_delta_x,-17-zmotor_delta_y,4]) nut_trap_base ();
// Cube
// #translate(v=[-2-2,-17,4]) cube(size = [8,16,8], center = true);
// Hexagon
// Top pushfit rod
translate(v=[-15,-41.5,rod_distance+bushing_xy[0]+pushrod_extra_z]) rotate(a=[-90,0,0]) pushfit_rod(pushfit_d,50);
// Nut trap
-translate(v=[-zmotor_delta_y,-17-zmotor_delta_x,3]) rotate ([0, 0, 45]) nut_trap ();
+translate(v=[zmotor_delta_x,-17-zmotor_delta_y,3]) rotate ([0, 0, 45]) nut_trap ();
// #translate(v=[0,-17,-0.5]) cylinder(h = 4, r1=3.4, r2=2.9, $fn=25);
// translate(v=[0,-17,3]) rotate([0,0,30]) cylinder(h = 10, r=hex_nut_r, $fn = 6);
}