$fn=128; // --- PARAMETERS --- body_length = 40; body_width = 26; body_height = 8; tail_L = [14, 13, 12, 11, 10]; tail_w = [12, 10, 8, 7, 6, 5]; // --- MAIN ASSEMBLY --- scorpion(); module scorpion() { scorpion_body(); // Tail Assembly tail_chain(0); // Left Claw Assembly translate([-body_length + 5, 14, 0]) rotate([0, 0, 110]) { flexi_link(15, 10, 12, body_height); translate([15, 0, 0]) claw(12, body_height, true); } // Right Claw Assembly translate([-body_length + 5, -14, 0]) rotate([0, 0, -110]) { flexi_link(15, 10, 12, body_height); translate([15, 0, 0]) claw(12, body_height, false); } } // --- MODULES --- module scorpion_body() { difference() { union() { // Main Carapace hull() { translate([-body_length + 5, 0, 0]) cylinder(r=10, h=body_height, center=true); translate([-body_length/2, 0, 0]) cylinder(r=body_width/2, h=body_height, center=true); translate([-tail_w[0]/2 - 1, 0, 0]) cylinder(r=tail_w[0]/2, h=body_height, center=true); } } // Flat bottom cut for printability translate([0, 0, -body_height/2 - 5]) cube([150, 100, 10], center=true); } // Carapace armor ridges for (i=[0:4]) { translate([-body_length/2 + i*7, 0, body_height/2]) scale([1, 2.5, 0.5]) sphere(r=3); } // Eyes translate([-body_length + 8, 3, body_height/2]) sphere(r=1.5); translate([-body_length + 8, -3, body_height/2]) sphere(r=1.5); // Tail male joint (Back) male_joint(tail_w[0], body_height); // Legs (4 pairs) for (i=[0:3]) { leg_x = -body_length + 10 + i*8; translate([leg_x, body_width/2 - 2, 0]) rotate([0, 0, 70 - i*15]) leg(); translate([leg_x, -body_width/2 + 2, 0]) rotate([0, 0, -70 + i*15]) scale([1, -1, 1]) leg(); } // Claw Attachments (Front) translate([-body_length + 5, 14, 0]) rotate([0, 0, 110]) male_joint(10, body_height); translate([-body_length + 5, -14, 0]) rotate([0, 0, -110]) male_joint(10, body_height); } module tail_chain(index=0) { if (index < 5) { flexi_link(tail_L[index], tail_w[index], tail_w[index+1], body_height); translate([tail_L[index], 0, 0]) tail_chain(index+1); } else { stinger(tail_w[index], body_height); } } module flexi_link(L, w1, w2, h) { // Segment Body hull() { translate([w1/2 + 1, 0, 0]) cylinder(r=w1/2 - 1, h=h, center=true); translate([L, 0, 0]) cylinder(r=w2/2 - 0.5, h=h, center=true); } // Female Hinge (Front) difference() { cylinder(r=w1/2, h=h, center=true); cube([w1+4, w1+4, 2.8], center=true); // Clearance slot } cylinder(r=1.5, h=h, center=true); // Vertical pivot pin // Male Hinge (Back) difference() { union() { translate([L, 0, 0]) cylinder(r=w2/2 - 0.5, h=1.6, center=true); translate([L - w2/4, 0, 0]) cube([w2/2, w2-1, 1.6], center=true); } translate([L, 0, 0]) cylinder(r=2.0, h=h+2, center=true); // Pivot hole } } module male_joint(w, h) { difference() { union() { cylinder(r=w/2 - 0.5, h=1.6, center=true); // Extended tab to embed securely into the parent body translate([-w/2 - 2, 0, 0]) cube([w + 4, w-1, 1.6], center=true); } cylinder(r=2.0, h=h+2, center=true); } } module stinger(w, h) { // Base Body hull() { translate([w/2 + 1, 0, 0]) cylinder(r=w/2 - 1, h=h, center=true); translate([w + 2, 0, 0]) cylinder(r=w/2, h=h, center=true); } // Female Hinge difference() { cylinder(r=w/2, h=h, center=true); cube([w+4, w+4, 2.8], center=true); } cylinder(r=1.5, h=h, center=true); // Curved Telson/Barb hull() { translate([w + 2, 0, h/2]) sphere(r=1.5); translate([w - 1, 0, h + 2]) sphere(r=0.5); } hull() { translate([w + 2, 0, h/2 - 1.5]) cylinder(r=1.5, h=3, center=true); translate([w + 2, 0, h/2]) sphere(r=1.5); } } module claw(w, h, is_left) { dir = is_left ? 1 : -1; // Claw Body and Pincers union() { hull() { translate([w/2 + 1, 0, 0]) cylinder(r=w/2 - 1, h=h, center=true); translate([12, dir*3, 0]) cylinder(r=w/1.5, h=h, center=true); } // Outer fixed finger hull() { translate([12, dir*3, 0]) cylinder(r=w/1.5, h=h, center=true); translate([25, dir*2, 0]) cylinder(r=1.5, h=h, center=true); } // Inner fixed finger hull() { translate([12, -dir*3, 0]) cylinder(r=w/2.5, h=h, center=true); translate([22, -dir*5, 0]) cylinder(r=1, h=h, center=true); } } // Female Hinge difference() { cylinder(r=w/2, h=h, center=true); cube([w+4, w+4, 2.8], center=true); } cylinder(r=1.5, h=h, center=true); } module leg() { translate([0, 0, -2]) { hull() { cylinder(r=2.5, h=4, center=true); translate([0, 15, 0]) cylinder(r=1.5, h=4, center=true); } hull() { translate([0, 15, 0]) cylinder(r=1.5, h=4, center=true); translate([5, 25, 0]) cylinder(r=0.5, h=4, center=true); } } }