Work on new function and added M4

This commit is contained in:
2025-01-14 17:08:25 -05:00
parent 8d21135673
commit 0125f7abc4

View File

@@ -3,6 +3,94 @@
function is_die() = (!is_undef($die) && $die);
function in_color() = (!is_undef($co) && $co);
module insert_clear(
bl=4, // Bolt Length (under head)
bz=-4, // Bolt offset
bhd=6,
bhz=3.5,
bd=3.5, // Bolt hole diameter
fd=5.6,
fh=.5,
od=4.8,
il=3.81,
sh=0,
) {
ic = in_color() ? "gold" : undef;
bc = in_color() ? "silver" : undef;
// Insert Body
translate([0,0,-fh]) color(ic) union() {
cylinder(d=fd, h=fh+.01);
translate([0,0,-(il-fh)]) cylinder(d=od,h=il-fh-sh);
}
// Bolt
color(bc) {
union() {
translate([0,0,bl+bz]) cylinder(d=bhd, h=bhz); // bolt head
translate([0,0,0]) cylinder(d=bd, h=bl+bz-sh); // bolt
translate([0,0,bz]) cylinder(d=bd, h=-(bz+il)) ; // bolt
}
}
}
module m4s_clear( bl=8, bz=-3.81, bhd=6, bhz=3.5, sh=.2) {
insert_clear(bl=bl, bz=bz, bhd=bhd, bhz=bhz, bd=3.5, fd=5.6, fh=.5, od=4.8, il=3.81, sh=sh);
}
module m3s_clear( bl=8, bz=-4.7, bhd=7.5, bhz=4, sh=.2) {
insert_clear(bl=bl, bz=bz, bhd=bhd, bhz=bhz, bd=4.5, fd=6.35, fh=.5, od=5, il=4.7, sh=sh);
}
module insert_initeq(
bl=4, bz=-4, invertRim=false,
fd=5.5,
fh=.45,
rd=5.75,
rh=.8,
tdd=4.8,
tdn=5.15,
bdd=3.5,
bdn=2.9,
) {
td= is_die() ? tdd : tdn;
th=(fh+2*(rh+.5));
ic = in_color() ? "gold" : undef;
// Bolt
bd = is_die() ? 3.5 : 2.9;
bhd = is_die() ? 6.5 : 5.7;
bhh = is_die() ? 3.5 : 3;
bc = in_color() ? "silver" : undef;
color(bc) {
translate([0,0,bl+bz]) cylinder(d=bhd, h=bhh); // bolt head
translate([0,0,bz-.01]) cylinder(d=bd, h=bl+.02); // bolt
}
color(ic) difference() {
union() {
if (! is_die() ) {
// Grip Rings
translate([0,0,invertRim ? -(rh+th+.05) : -fh])
cylinder(d=fd,h=fh+.01);
translate([0,0,-(fh+rh+.5)]) cylinder(d=rd,h=rh);
translate([0,0, invertRim ? -(th) : -th]) cylinder(d=rd,h=rh);
} else {
// top bezel for die
translate([0,0,invertRim ? -(rh+th+.05) : -fh])
cylinder(d=5.6, h=fh);
}
translate([0,0,-(3.9)]) cylinder(d=td,h=3.91);
}
if (! is_die()) // xxx: threaded hole stand in
translate([0,0,-3.95]) cylinder(d=2.9,h=4);
}
}
module thread_insertM3(bl=4, bz=-4, invertRim=false) {
fd=5.5;
fh=.45;