$fn = 128; // --- Parameters --- layout = 0; // [0: Print flat parts, 1: Assembled view] // Jaw Dimensions jaw_length = 160; jaw_width = 25; jaw_height = 25; hole1_pos = 45; hole2_pos = 115; // Screw Dimensions screw_d = 14; screw_len = 140; handle_d = 26; handle_len = 60; pitch = 16; // Thread pitch (mm per turn) clearance = 0.5; // Tolerance for threads and holes // --- Modules --- // Hexagonal profile for highly 3D-printable threads module thread_hole(clear=clearance) { // Bottom clean cut translate([0, 0, -1]) cylinder(d=screw_d + clear, h=1.01, $fn=6); // Twisted thread body linear_extrude(height=jaw_height, twist=jaw_height*360/pitch) circle(d=screw_d + clear, $fn=6); // Top clean cut (rotated to match the final twist phase) translate([0, 0, jaw_height-0.01]) rotate([0, 0, jaw_height*360/pitch]) cylinder(d=screw_d + clear, h=1.01, $fn=6); } module jaw_body() { hull() { // Tapered front tip translate([jaw_width/2, jaw_width/2, 0]) cylinder(d=jaw_width, h=jaw_height - 10); // Flat section starts before the first hole translate([hole1_pos - 15, jaw_width/2, 0]) cylinder(d=jaw_width, h=jaw_height); // Full height back end translate([jaw_length - jaw_width/2, jaw_width/2, 0]) cylinder(d=jaw_width, h=jaw_height); } } module jaw1() { difference() { jaw_body(); // Hole 1 (Front): Clearance hole for screw 1 translate([hole1_pos, jaw_width/2, -1]) cylinder(d=screw_d + clearance*2 + 1, h=jaw_height+2); // Hole 2 (Back): Threaded hole for screw 2 translate([hole2_pos, jaw_width/2, 0]) thread_hole(clearance); } } module jaw2() { difference() { jaw_body(); // Hole 1 (Front): Threaded hole for screw 1 translate([hole1_pos, jaw_width/2, 0]) thread_hole(clearance); // Hole 2 (Back): Blind socket for screw 2 tip to push against translate([hole2_pos, jaw_width/2, -1]) cylinder(d=screw_d + clearance*2 + 1, h=jaw_height/2 + 1); } } module screw() { union() { // Handle with grip grooves difference() { cylinder(d=handle_d, h=handle_len); for (i=[0:45:315]) { rotate([0, 0, i]) translate([handle_d/2, 0, handle_len/2]) cylinder(d=3, h=handle_len+2, center=true); } } // Chamfer transition translate([0, 0, handle_len - 0.1]) cylinder(d1=handle_d, d2=screw_d, h=5.2); // Threaded Rod (Hexagonal sweep matches the thread_hole) translate([0, 0, handle_len + 5]) linear_extrude(height=screw_len, twist=screw_len*360/pitch) circle(d=screw_d, $fn=6); // Rounded Tip translate([0, 0, handle_len + 5 + screw_len]) sphere(d=screw_d-1, $fn=32); } } // --- Assembly / Layout --- if (layout == 0) { // Print-in-place flat layout translate([0, 20, 0]) jaw1(); translate([0, -20, 0]) jaw2(); translate([jaw_length + 30, 20, 0]) screw(); translate([jaw_length + 30, -20, 0]) screw(); } else { // Assembled View gap = 30; // Distance between jaws // Back Jaw (Inside face at Z=0) jaw2(); // Front Jaw (Rotated to face Jaw 2) translate([0, jaw_width, -gap]) rotate([180, 0, 0]) jaw1(); // Front Screw (Pulls jaws together) translate([hole1_pos, jaw_width/2, -gap - jaw_height - handle_len - 5]) screw(); // Back Screw (Pushes jaws apart to set angle) translate([hole2_pos, jaw_width/2, -(handle_len + 5 + screw_len)]) screw(); }