Files
home/Keychain/keychain.scad
T
2026-07-12 11:43:07 -07:00

103 lines
1.8 KiB
OpenSCAD

difference() {
body_with_rounded_hole();
trnalsate([
resize([0, 0, 1.01])
trace();
}
color("red")
trace();
module trace() {
difference() {
hull() {
translate([19, 19, 0])
cylinder(h=1, d=3, $fn=100);
translate([19, 5, 0])
cylinder(h=1, d=3, $fn=100);
translate([65, 19, 0])
cylinder(h=1, d=3, $fn=100);
translate([65, 5, 0])
cylinder(h=1, d=3, $fn=100);
}
translate([0, 0, -1])
resize([0, 0, 3])
hull() {
translate([19, 19, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([19, 5, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([65, 19, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([65, 5, 0])
cylinder(h=1.02, d=2, $fn=100);
}
}
}
module body_with_rounded_hole() {
body_with_hole();
hole_rounding();
}
module body_with_hole() {
difference() {
body();
translate([10, 12, -0.01])
cylinder(h=7.02, d=12);
}
}
module hole_rounding() {
difference() {
translate([10, 12, 2])
cylinder(d=12, h=3);
translate([10, 12, 0])
cylinder(d=8, h=7, $fn=100);
}
translate([10, 12, 5])
torus(r1=6, r2=2, $fn=100);
translate([10, 12, 2])
torus(r1=6, r2=2, $fn=100);
}
module body() {
hull() {
end();
translate([52, 0, 0])
end();
}
}
module end() {
translate([12, 12, 0])
cylinder(h=7, d=20, $fn=100);
translate([12, 12, 2])
cylinder(h=3, d=24, $fn=100);
translate([12, 12, 2])
torus(r1=10, r2=2, $fn=100);
translate([12, 12, 5])
torus(r1=10, r2=2, $fn=100);
}
module torus(r1, r2) {
rotate_extrude()
translate([r1,0,0])
circle(r2);
}