// manec
l=70;
w=10;
// gruix
h=4;
// veure https://en.wikipedia.org/wiki/ISO_metric_screw_thread#Hex_head_widths
// M3
r1=10;
n1=5.5;
// M4
r2=12;
n2=7;
f1=n1+0.5;
f2=n2+0.5;
p1=f1/sqrt(3);
p2=f2/sqrt(3);
difference(){
union () {
translate ([0,-w/2,0]) cube ([l, w, h]);
cylinder (r=r1, h=h, $fn=48);
translate ([l,0,0]) cylinder (r=r2, h=h, $fn=48);
}
union () {
translate ([-p1,0,0]) rotate ([0,0,15]) cylinder (r=p1,h=h, $fn=6);
translate ([-p1,0,0]) mirror ([1,0,0]) rotate ([0,0,-15]) translate ([0,-f1/2,0]) cube ([r1,f1,h]);
translate ([l+p2,0,0]) rotate ([0,0,15]) cylinder (r=p2,h=h, $fn=6);
translate ([l+p2,0,0]) rotate ([0,0,15]) translate ([0,-f2/2,0]) cube ([r2,f2,h]);
}
}