include sdk = 12; d_in = 104; d_out = 140; wall = 1.2; h_out = 3; h_in = h_out + 8.5; out_angle = 60; thin_wall = 0.70; rib_angle = 60; rib_w = 5; rib_dist = 9; rib_off = 1; top_beam_w = 15; top_beam_h = 2; clip_wall = 4; clip_mid = clip_wall + 3; clip_end_d = 40; magnet_d = 10 + 0.5; magnet_h = 0.8 + 0.1; magnet_off = d_in/2 - 1.5*magnet_d; $fn = 256; difference() { cylinder(r1 = d_out/2-h_out*cos(out_angle), r2 = d_out/2, h = h_out); Tz(wall) cylinder(r1 = d_out/2-wall-h_out*cos(out_angle), r2 = d_out/2-wall, h = h_out); Tz(-eps) cylinder(r = d_in/2-wall+eps, h = wall+2*eps); } difference() { cylinder(r = d_in/2, h = h_in); Tz(-eps) cylinder(r = d_in/2-wall, h = h_in + 2*eps); } difference() { intersection() { cylinder(r = d_in/2-wall/2, h = h_in); union() { for(i = [-d_in/2+rib_off:rib_dist:d_in/2]) Tx(i) Ty(-d_in/2) { Tx(-rib_w/2) cube([rib_w, d_in, thin_wall]); Tx(rib_w/2)Ry(-rib_angle) cube([h_in/cos(rib_angle), d_in, thin_wall]); } translate([-d_in/2, -top_beam_w/2, h_in-top_beam_h]) cube([d_in, top_beam_w, top_beam_h]); } } for (x = [-1, 1]) Sx(x) Tx(magnet_off) Tz(h_in-magnet_h) cylinder(r = magnet_d/2, h = magnet_h+eps); } Ty(d_out/2 + top_beam_w/2 + 5) difference() { union() { for(x = [-1, 1]) Sx(x) { Tx(d_out/2-clip_end_d/2) cylinder(r = clip_end_d/2, h = clip_wall); } hull() for(x = [-1, 1]) Sx(x) { Tx(d_out/2-top_beam_w/2) cylinder(r = top_beam_w/2, h = clip_wall); } hull() for(x = [-1, 1]) Sx(x) { Tx(magnet_off) cylinder(r = top_beam_w/2, h = clip_mid); } } for (x = [-1, 1]) Sx(x) Tx(magnet_off) Tz(clip_mid-magnet_h) cylinder(r = magnet_d/2, h = magnet_h+eps); }