// ============================================================================= // Parametric Pipe & Cable Clip (OpenSCAD) // ----------------------------------------------------------------------------- // Snap-in wall clip for pipes, cables, hoses and conduit. The mounting screw // goes through the bottom of the pipe seat, with a countersunk (single or // two-angle), socket-head or captive hex-nut recess. // // Independent OpenSCAD re-creation of the feature set of "Ultimate Parametric // Pipe & Cable Clip" by Shock0991 on MakerWorld (model 3063346). No files from // that listing were used. // // Units: mm. Generated in print orientation: profile flat on the bed, clamp // width = print height, no supports. PETG recommended; TPU suits cables. // Works in OpenSCAD 2021.01 and newer (Window > Customizer for the sliders). // ============================================================================= /* [Clip] */ // Outside diameter of the pipe or cable. Add a little clearance (about 0.1 mm) unless you want a press fit. pipe_diameter = 25; // [2:0.1:200] // Opening between the arm tips as seen from the pipe axis, in degrees. Smaller grips tighter; larger snaps in more easily. Keep at or below 150. gap_angle = 100; // [1:1:150] // Thickness of the arms. 3-5 mm suits most clips; larger pipes benefit from thicker arms. arm_thickness = 4; // [1:0.1:20] // Overall width of the clip along the pipe (this is the print height). clamp_width = 15; // [3:0.5:100] // Minimum distance between the wall and the nearest point of the pipe. 10 mm or more is recommended. wall_distance = 10; // [1:0.5:150] /* [Mounting] */ // How the clip is fastened. Two-angle countersunk heads (common on wood and construction screws) have a second, narrower cone under the main one. mount_type = "two_angle"; // [two_angle:Two-angle countersunk screw, countersunk:Countersunk screw, socket_head:Socket head screw, hex_nut:Hex nut for a bolt from behind, plain:Plain hole, none:No hole] // Mounting hole diameter: the screw's thread plus room to pass freely (#8 wood screw: 4.5; M5: 5.5). hole = 4.5; // [1:0.1:20] // Extra diameter given to the recess for the screw head or nut so it drops in. 0.4 suits most printers. recess_clearance = 0.4; // [0:0.05:2] // How far the top of the seated screw head (or nut) sits below the bottom of the pipe seat, so it never presses on the pipe. screw_head_recess = 0.3; // [0:0.1:20] /* [Screw] */ // Screw head diameter as measured (#8 wood screw: 8.6; M5 flat head: 10; M5 cap screw: 8.5). The recess adds recess_clearance. screw_head_diameter = 8.6; // [2:0.1:40] // Two-angle heads: height of the straight lip at the very top of the head, above the cones (0 for a sharp edge). screw_head_lip_height = 0.9; // [0:0.05:10] // Two-angle heads: height of the upper cone, from under the lip to where the cones meet. Its angle is worked out from the sizes. screw_head_upper_height = 2.1; // [0.1:0.05:20] // Two-angle heads: diameter where the two cones meet. screw_head_transition_diameter = 5.6; // [1:0.1:40] // Two-angle heads: height of the lower cone, from where the cones meet down to the shank. screw_head_lower_height = 3; // [0.1:0.05:20] // Countersunk heads: included angle of the head (82 for imperial flat heads, 90 for metric). screw_head_angle = 82; // [60:1:150] // Socket head screws: height of the head (M5 cap screw: 5). screw_head_height = 5; // [0.5:0.1:30] // Countersunk heads: diameter of the smooth shank under the head (#8 wood screw: 3.2; machine screws: the thread diameter). screw_shank_diameter = 3.2; // [1:0.1:20] // Thread diameter (#8: 4.2; M5: 5). Checked against the hole and drawn in the preview. screw_diameter = 4.2; // [1:0.1:20] // Length as sold: overall for countersunk heads, under the head for socket-head screws and bolts (1-1/2 in: 38.1). screw_length = 38.1; // [3:0.1:200] /* [Hex nut] */ // Nut size across the flats as measured (M5: 8). The pocket adds recess_clearance. nut_size = 8; // [2:0.1:40] // Nut height (M5: 4). The pocket is this deep plus the screw head recess. nut_height = 4; // [0.5:0.1:30] /* [Batch] */ // Number of clips along X. x_count = 1; // [1:1:20] // Number of clips along Y. y_count = 1; // [1:1:20] // Gap between clips in a batch. spacing = 5; // [1:0.5:50] /* [Finish] */ // Treatment for every outside edge: a rounded fillet, a flat 45-degree chamfer (which prints cleanest on the bed), or none (sharp edges). edge_style = "fillet"; // [fillet:Fillet, chamfer:Chamfer, none:None (sharp)] // Fillet radius or chamfer size on every outside edge (not used when edge_style is none). edge_size = 0.8; // [0:0.1:3] // Show a transparent pipe in the preview (never exported). show_pipe = false; // Show the screw, or the bolt and nut, seated in the preview (never exported). show_screw = false; /* [Hidden] */ $fa = 2; $fs = 0.25; eps = 0.01; // ---------------------------------------------------------------- derived --- edge = edge_style == "none" ? 0 : edge_size; // fillet radius or chamfer size actually applied R = pipe_diameter / 2; t = arm_thickness; Ro = R + t; // outer radius of the arms axis_y = wall_distance + R; // pipe axis distance from the wall face tip_r = t / 2; // arm tips are full rounds tip_c = R + tip_r; // radius of the tip centres tip_phi_wanted = gap_angle / 2 + asin(tip_r / tip_c); // tip-centre angle from the open (+Y) direction tip_phi = min(tip_phi_wanted, 89); // arms always reach past the pipe centre line clip_length = axis_y + tip_c * cos(tip_phi) + tip_r; // wall face to arm tips opening = 2 * (tip_c * sin(tip_phi) - tip_r); c = recess_clearance; two_angle = mount_type == "two_angle"; countersunk = mount_type == "countersunk" || two_angle; screw_mount = countersunk || mount_type == "socket_head"; has_recess = screw_mount || mount_type == "hex_nut"; head_top = wall_distance - screw_head_recess; // Y of the top of the seated screw head / nut lip = two_angle ? screw_head_lip_height : 0; // straight lip at the top of a two-angle head // Countersunk heads: half-angles of the upper (or only) cone and of the lower cone. A // two-angle head's angles are worked out from its measured diameters and heights. cone1 = two_angle ? atan((screw_head_diameter - screw_head_transition_diameter) / 2 / screw_head_upper_height) : screw_head_angle / 2; cone2 = two_angle ? atan((screw_head_transition_diameter - screw_shank_diameter) / 2 / screw_head_lower_height) : cone1; head_height = // top of the head to the shank (or its underside) two_angle ? lip + screw_head_upper_height + screw_head_lower_height : countersunk ? (screw_head_diameter - screw_shank_diameter) / 2 / tan(cone1) : screw_head_height; // The countersink is the head widened by the clearance, raised until the head bears on its // upper cone, so the seated head top lands at head_top. Above the cone it runs straight up, // as wide, past the head's lip and through the pipe seat. cs_top = head_top - lip + (countersunk ? c / 2 / tan(cone1) : 0); // Y of the top of the countersink cone cs_mid = screw_head_transition_diameter + c; // where a two-angle countersink's cones meet cs_depth = // countersink depth below cs_top two_angle && hole < cs_mid ? screw_head_upper_height + (cs_mid - hole) / 2 / tan(cone2) : (screw_head_diameter + c - hole) / 2 / tan(cone1); pocket_floor = // Y of the deepest recess point countersunk ? cs_top - cs_depth : mount_type == "socket_head" ? head_top - screw_head_height : mount_type == "hex_nut" ? head_top - nut_height : wall_distance; recess_x = // recess width across the clip screw_mount ? screw_head_diameter + c : mount_type == "hex_nut" ? (nut_size + c) * 2 / sqrt(3) : mount_type == "plain" ? hole : 0; recess_z = // recess size along the pipe mount_type == "hex_nut" ? nut_size + c : recess_x; insert_size = // what must pass between the arms mount_type == "hex_nut" ? nut_size : screw_head_diameter; screw_reach = // screw length beyond the wall face countersunk ? screw_length - head_top : screw_length + screw_head_height - head_top; bolt_panel = screw_length - head_top; // hex nut: thickest wall or panel the bolt clears pitch_x = 2 * Ro + spacing; // batch layout pitch_y = clip_length + spacing; function r1(x) = round(x * 10) / 10; function r2(x) = round(x * 100) / 100; // ------------------------------------------------------------- validation --- assert(gap_angle >= 1 && gap_angle < 180, "gap_angle must be between 1 and 180 degrees"); assert(edge_size >= 0, "edge_size cannot be negative"); assert(clamp_width > 2 * edge, "clamp_width must exceed 2 x edge_size"); assert(arm_thickness > 2 * edge, "arm_thickness must exceed 2 x edge_size"); assert(wall_distance > 2 * edge, "wall_distance must exceed 2 x edge_size"); assert(!screw_mount || screw_head_diameter > hole, "screw_head_diameter must be larger than hole"); assert(!countersunk || screw_shank_diameter < screw_head_diameter, "screw_shank_diameter must be smaller than screw_head_diameter"); assert(!two_angle || screw_head_transition_diameter < screw_head_diameter, "screw_head_transition_diameter must be smaller than screw_head_diameter"); assert(!two_angle || screw_shank_diameter < screw_head_transition_diameter, "screw_shank_diameter must be smaller than screw_head_transition_diameter"); assert(screw_head_angle > 0 && screw_head_angle < 180, "screw_head_angle must be between 0 and 180 degrees"); assert(screw_head_recess >= 0, "screw_head_recess cannot be negative"); assert(screw_head_lip_height >= 0, "screw_head_lip_height cannot be negative"); assert(recess_clearance >= 0, "recess_clearance cannot be negative"); assert(mount_type != "hex_nut" || nut_size > hole, "nut_size must be larger than hole"); assert(pocket_floor > 0, "The screw head / nut recess reaches the wall face: increase wall_distance or reduce the recess"); echo(str("Clip ", r2(2 * Ro), " x ", r2(clip_length), " x ", r2(clamp_width), " mm (width x depth from wall x print height); pipe axis ", r2(axis_y), " mm from the wall")); echo(str("Arm opening ", r2(opening), " mm; snap interference ", r2(max(0, pipe_diameter - opening)), " mm")); if (mount_type == "countersunk") echo(str("Countersink ", r2(screw_head_diameter + c), " mm at ", screw_head_angle, " degrees, ", r2(cs_depth), " mm deep; head top ", r2(screw_head_recess), " mm below the pipe seat")); if (two_angle) // Measured down from the pipe seat; the countersink runs straight past the head's lip first. echo(str("Two-angle countersink ", r2(screw_head_diameter + c), " mm wide, ", r2(wall_distance - pocket_floor), " mm deep: ", lip > 0 && wall_distance - cs_top >= 0.01 ? str("straight for ", r2(wall_distance - cs_top), " mm, then ") : "", r1(2 * cone1), " degrees down to ", r2(cs_mid), " mm, then ", r1(2 * cone2), " degrees; head top ", r2(screw_head_recess), " mm below the pipe seat")); if (mount_type == "socket_head") echo(str("Counterbore ", r2(screw_head_diameter + c), " mm wide, ", r2(screw_head_recess + screw_head_height), " mm deep; head top ", r2(screw_head_recess), " mm below the pipe seat")); if (mount_type == "hex_nut") echo(str("Nut pocket ", r2(nut_size + c), " mm across flats, ", r2(screw_head_recess + nut_height), " mm deep; nut top ", r2(screw_head_recess), " mm below the pipe seat")); if (has_recess) echo(str("Material between the wall and the screw head / nut: ", r2(pocket_floor), " mm")); if (screw_mount) echo(str("Screw into the wall: ", r2(screw_reach), " mm")); if (mount_type == "hex_nut") echo(str("Bolt fits a wall or panel up to ", r2(bolt_panel), " mm thick")); if (x_count * y_count > 1) echo(str("Batch of ", x_count * y_count, " clips: footprint ", r2(x_count * pitch_x - spacing), " x ", r2(y_count * pitch_y - spacing), " mm")); if (gap_angle > 150) echo("WARNING: gap_angle above 150 degrees leaves little to hold the pipe."); if (tip_phi_wanted > tip_phi) echo("WARNING: the opening is too wide for these arms; their ends were extended to the pipe centre line."); if (has_recess && hole < screw_diameter) echo("WARNING: the hole is narrower than the screw_diameter, so the screw will bind; increase hole."); if (two_angle && cs_mid <= hole) echo("WARNING: the hole is wider than the screw_head_transition_diameter plus clearance, so only the upper cone is cut."); if (screw_mount && screw_reach <= 0) echo("WARNING: the screw_length is too short to reach the wall."); if (mount_type == "hex_nut" && bolt_panel <= 0) echo("WARNING: the screw_length is too short for the bolt to reach the nut."); if (has_recess && pocket_floor < 2) echo("WARNING: less than 2 mm of material behind the screw head / nut; increase wall_distance."); if (recess_z > clamp_width - 2 * edge) echo("WARNING: the screw head / nut recess is wider than the clip; increase clamp_width."); if (recess_x > pipe_diameter) echo("WARNING: the screw head / nut is wider than the pipe seat and cuts into the arms."); if (has_recess && insert_size > opening) echo("WARNING: the screw head / nut is wider than the arm opening; spring the arms open to install it."); // ----------------------------------------------------------------- model --- // The clip is one polyhedron: the profile is built exactly from its lines and // arcs at a series of insets, and those outlines are stacked up the print height. // Insetting by d(z) near the bed and the top turns every outside edge into a true // fillet (quarter circle) or 45-degree chamfer, and every ring keeps the same // vertices, so the edge surfaces are smooth rather than stepped. function frags(r) = ceil(max(min(360 / $fa, r * 2 * PI / $fs), 5)); function arc(c, r, a0, a1, n) = [for (i = [0 : n]) c + r * [cos(a0 + (a1 - a0) * i / n), sin(a0 + (a1 - a0) * i / n)]]; function tail(v) = [for (i = [1 : len(v) - 1]) v[i]]; function reverse(v) = [for (i = [len(v) - 1 : -1 : 0]) v[i]]; // Segments per arc, fixed so every inset outline has the same vertices. n_out = max(1, ceil(frags(Ro) * (90 - tip_phi) / 360)); n_tip = max(4, ceil(frags(tip_r) / 2)); n_bore = max(8, ceil(frags(R) * (360 - 2 * tip_phi) / 360)); n_corner = max(2, ceil(frags(edge) / 4)); n_band = edge <= 0 ? 0 : edge_style == "chamfer" ? 1 : max(3, ceil(frags(edge) / 4)); // Back corner of the profile (where the wall face meets the right side), inset by d. function corner(d) = edge <= 0 ? [[Ro, 0]] : edge_style == "chamfer" ? [[Ro - edge - d * (sqrt(2) - 1), d], [Ro - d, edge + d * (sqrt(2) - 1)]] : let(rc = max(edge - d, 0.01)) arc([Ro - d - rc, d + rc], rc, 270, 360, n_corner); // Clip profile inset by d, counter-clockwise: wall face on y = 0, pipe axis at (0, axis_y). function outline(d) = let( C = [0, axis_y], ar = 90 - tip_phi, // direction of the right arm tip al = 90 + tip_phi, // direction of the left arm tip right = corner(d), left = [for (p = reverse(right)) [-p[0], p[1]]] ) concat( left, // left side -> wall face right, // wall face -> right side arc(C, Ro - d, 0, ar, n_out), // right arm, outside tail(arc(C + tip_c * [cos(ar), sin(ar)], tip_r - d, ar, ar + 180, n_tip)), // right tip tail(arc(C, R + d, ar, al - 360, n_bore)), // pipe seat tail(arc(C + tip_c * [cos(al), sin(al)], tip_r - d, al + 180, al + 360, n_tip)), // left tip tail(arc(C, Ro - d, al, 180, n_out)) // left arm, outside ); // [z, inset] for each outline, from the bed to the top of the clip. bed_band = [for (i = [0 : n_band]) edge_style == "chamfer" ? [edge * i / n_band, edge * (1 - i / n_band)] : let(a = 90 * i / n_band) [edge * (1 - cos(a)), edge * (1 - sin(a))]]; levels = edge <= 0 ? [[0, 0], [clamp_width, 0]] : concat(bed_band, [for (p = reverse(bed_band)) [clamp_width - p[0], p[1]]]); module clip_body() { rings = [for (lv = levels) outline(lv[1])]; n = len(rings[0]); m = len(levels); points = [for (k = [0 : m - 1]) for (p = rings[k]) [p[0], p[1], levels[k][0]]]; sides = [for (k = [0 : m - 2]) for (j = [0 : n - 1]) let(a = k * n + j, b = k * n + (j + 1) % n) each [[a, a + n, b + n], [a, b + n, b]]]; polyhedron(points, concat([[for (j = [0 : n - 1]) j]], sides, [[for (j = [n - 1 : -1 : 0]) (m - 1) * n + j]]), convexity = 6); } // Height (along Y) of the pipe-seat surface at lateral offset x. function seat_y(x) = abs(x) < R ? axis_y - sqrt(R * R - x * x) : axis_y; // Mounting hole and recess, centred in the clip width, axis along +Y. module mount_cut() { // The recess opens fully into the seat (and clears a countersink raised above it). clear_top = max(seat_y(recess_x / 2), countersunk ? cs_top : 0) + 0.5; if (mount_type != "none") translate([0, 0, clamp_width / 2]) rotate([-90, 0, 0]) { if (countersunk) { // Hole, lower cone (two-angle heads only), upper cone and head clearance as one // solid of revolution, so the cones meet exactly at the transition diameter. rotate_extrude($fn = frags(recess_x / 2)) polygon(concat( [[0, -1], [hole / 2, -1], [hole / 2, pocket_floor]], two_angle && hole < cs_mid ? [[cs_mid / 2, cs_top - screw_head_upper_height]] : [], [[recess_x / 2, cs_top], [recess_x / 2, clear_top], [0, clear_top]])); } else { translate([0, 0, -1]) cylinder(d = hole, h = axis_y + 1); if (mount_type == "socket_head") { translate([0, 0, pocket_floor]) cylinder(d = recess_x, h = clear_top - pocket_floor); } else if (mount_type == "hex_nut") { // Flats face the print direction, so the pocket roof prints as a short bridge. translate([0, 0, pocket_floor]) cylinder(r = (nut_size + c) / sqrt(3), h = clear_top - pocket_floor, $fn = 6); } } } } // ---------------------------------------------------------- preview screw --- // The screw (or the bolt and nut) as measured, seated in the clip, in its own frame: // axis along +Z, top of the head or nut at Z = 0. The thread is drawn with a typical // pitch for its diameter; reduced shanks mark wood screws, which get coarse threads // and a gimlet point. wood_screw = countersunk && screw_shank_diameter < 0.85 * screw_diameter; thread_pitch = wood_screw ? 0.6 * screw_diameter : lookup(screw_diameter, [[1.6, 0.35], [2, 0.4], [2.5, 0.45], [3, 0.5], [4, 0.7], [5, 0.8], [6, 1], [8, 1.25], [10, 1.5], [12, 1.75], [16, 2], [20, 2.5]]); thread_root = wood_screw ? min(screw_shank_diameter, 0.75 * screw_diameter) : screw_diameter - 1.23 * thread_pitch; // A threaded length rising from a gimlet point or a chamfered end at Z = 0. module thread(len, pointed) { tip = pointed ? 1.2 * screw_diameter : 0.6 * thread_pitch; intersection() { union() { cylinder(d = thread_root, h = len); // A twisted off-centre circle sweeps a right-hand helical ridge. linear_extrude(height = len, twist = -360 * len / thread_pitch, slices = ceil(len / thread_pitch * 12)) translate([(screw_diameter - thread_root) / 4, 0]) circle(d = (screw_diameter + thread_root) / 2, $fn = 24); } union() { cylinder(d1 = pointed ? 0 : thread_root, d2 = screw_diameter, h = tip); translate([0, 0, tip - eps]) cylinder(d = screw_diameter + 1, h = len); } } } module fastener() { d = screw_diameter; machine_thread = min(screw_length, 2 * d + 12); // threaded length of a machine screw or bolt if (countersunk) { body = screw_length - head_height; shank = wood_screw && body > 4 * d ? 0.25 * body : 0; rotate_extrude() polygon(concat( [[0, 0], [screw_head_diameter / 2, 0]], lip > 0 ? [[screw_head_diameter / 2, -lip]] : [], two_angle ? [[screw_head_transition_diameter / 2, -lip - screw_head_upper_height]] : [], [[screw_shank_diameter / 2, -head_height], [screw_shank_diameter / 2, -head_height - shank - eps], [0, -head_height - shank - eps]])); translate([0, 0, -screw_length]) thread(body - shank, wood_screw); } else if (mount_type == "socket_head") { difference() { translate([0, 0, -screw_head_height]) cylinder(d = screw_head_diameter, h = screw_head_height); translate([0, 0, -screw_head_height / 2]) cylinder(r = 0.47 * screw_head_diameter / sqrt(3), h = screw_head_height, $fn = 6); } translate([0, 0, -screw_head_height - screw_length]) { thread(machine_thread, false); translate([0, 0, machine_thread - eps]) cylinder(d = d, h = screw_length - machine_thread + 2 * eps); } } else if (mount_type == "hex_nut") { translate([0, 0, -nut_height]) cylinder(r = nut_size / sqrt(3), h = nut_height, $fn = 6); // The bolt comes from behind the wall; its end stands 1.5 threads above the nut. bolt_end = 1.5 * thread_pitch; translate([0, 0, bolt_end]) rotate([180, 0, 0]) { thread(machine_thread, false); translate([0, 0, machine_thread - eps]) cylinder(d = d, h = screw_length - machine_thread + 2 * eps); translate([0, 0, screw_length]) cylinder(r = (1.5 * d + 0.5) / sqrt(3), h = 0.7 * d, $fn = 6); } } } module clip() { difference() { clip_body(); mount_cut(); } if (show_pipe) %translate([0, axis_y, -clamp_width / 2]) cylinder(d = pipe_diameter, h = 2 * clamp_width); if (show_screw && has_recess) %translate([0, 0, clamp_width / 2]) rotate([-90, 0, 0]) translate([0, 0, head_top]) fastener(); } for (ix = [0 : x_count - 1], iy = [0 : y_count - 1]) translate([(ix - (x_count - 1) / 2) * pitch_x, (iy - (y_count - 1) / 2) * pitch_y - clip_length / 2, 0]) clip();