// Parametric snap-on bar clip (units: mm) // Fine tune bar_d to match your bar. 0.5 in = 12.7 mm. bar_d = 12.7; // bar diameter thickness = 25.4; // clip thickness along the bar (1 in = 25.4) clearance = 0.2; // extra room around the bar wall = 3.0; // ring wall gap_ratio = 0.8; // snap opening / bar diameter base = true; // flat mounting base base_w = 40.0; base_t = 4.0; $fn = 96; ri = bar_d/2 + clearance; ro = ri + wall; gap = min(gap_ratio*bar_d, 2*ri*0.99); linear_extrude(height = thickness) difference() { union() { circle(r = ro); if (base) translate([-base_w/2, -ro - base_t]) square([base_w, base_t + min(1, wall/2)]); } circle(r = ri); // snap opening at the top translate([-gap/2, 0]) square([gap, ro + 1]); }