$fn=128; // --- PARAMETERS --- gap = 60; // Maximum opening of the clamp depth = 50; // Throat depth thickness = 15; // Thickness of the clamp body width = 20; // Width of the clamp arms screw_r = 8; // Radius of the screw (16mm diameter) pitch = 8; // Thread pitch (coarse for easy 3D printing) tolerance = 0.6; // Clearance for moving parts screw_length = gap + 30; // Total length of the threaded shaft // --- PRINT LAYOUT --- // Arrange parts flat on the build plate translate([0, 0, 0]) clamp_body(); translate([depth + 40, 0, 15]) screw(); translate([depth + 80, 0, 0]) swivel_pad(); // --- MODULES --- // Generates a smooth, printable hex-based thread profile module thread_profile(r) { offset(r=1.5) circle(r=r-1.5, $fn=6); } // Extrudes the profile into a helical thread module screw_thread(length, r, p) { linear_extrude(height=length, twist=-360*length/p, slices=length*2) thread_profile(r); } // Main C-Clamp Body module clamp_body() { R = 8; // Inner corner radius difference() { // Main outer shape hull() { // Back spine translate([-width/2, -width/2, 0]) cylinder(r=width/2, h=thickness); translate([-width/2, gap + width/2, 0]) cylinder(r=width/2, h=thickness); // Top arm (Anvil) translate([depth + width/2, -width/2, 0]) cylinder(r=width/2, h=thickness); // Bottom arm (Thread boss) translate([depth + width/2, gap + width/2, 0]) cylinder(r=width/2, h=thickness); } // Inner cutout translate([0, 0, -1]) hull() { translate([R, R, 0]) cylinder(r=R, h=thickness+2); translate([depth+width+1, R, 0]) cylinder(r=R, h=thickness+2); translate([R, gap-R, 0]) cylinder(r=R, h=thickness+2); translate([depth+width+1, gap-R, 0]) cylinder(r=R, h=thickness+2); } // Threaded Hole translate([depth + width/2, gap + width/2, -1]) screw_thread(length=thickness + 2, r=screw_r + tolerance, p=pitch); // Chamfers for easier screw insertion translate([depth + width/2, gap + width/2, -1]) cylinder(r1=screw_r + 2, r2=screw_r, h=2); translate([depth + width/2, gap + width/2, thickness - 1]) cylinder(r1=screw_r, r2=screw_r + 2, h=2); } } // Threaded Screw with Knob and Ball Joint module screw() { ball_r = screw_r - 2; union() { // Threaded Shaft screw_thread(length=screw_length, r=screw_r, p=pitch); // Knurled Handle translate([0, 0, -15]) { difference() { cylinder(r=screw_r * 2.5, h=15.1); // 0.1mm overlap for manifoldness // Knurling cutouts for(i=[0:20:340]) { rotate([0, 0, i]) translate([screw_r * 2.5 + 1, 0, 7.5]) cylinder(r=2.5, h=17, center=true); } } } // Swivel Ball Tip translate([0, 0, screw_length - 0.1]) { cylinder(r=ball_r - 1.5, h=3.2); // Neck translate([0, 0, 3.1 + ball_r]) sphere(r=ball_r); // Ball } } } // Snap-on Swivel Foot module swivel_pad() { ball_r = screw_r - 2; pad_r = 12; pad_h = 12; difference() { // Pad body cylinder(r=pad_r, h=pad_h); // Ball socket translate([0, 0, pad_h - ball_r + 0.5]) { sphere(r=ball_r + 0.4); // Socket cavity with tolerance // Neck opening (slightly restricted for snap fit) cylinder(r=ball_r - 0.4, h=ball_r + 2); } // Flex slits to allow the ball to snap in translate([0, 0, pad_h - ball_r + 1]) { cube([pad_r * 2 + 2, 1.5, ball_r * 2], center=true); cube([1.5, pad_r * 2 + 2, ball_r * 2], center=true); } } }