try gritfinity

This commit is contained in:
Laila van Reenen 2025-01-07 00:56:26 +01:00
parent a5a28858fd
commit 928065c2ef
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D

63
gridfinity.scad Normal file
View File

@ -0,0 +1,63 @@
$fn=50;
HIEGHT = 1;
module square_rounded(size1, size2, r1, r2, h) {
union() {
difference() {
translate([0, 0, h/2]) {
cube([size1-r1*2, size2, h], center=true);
cube([size2, size1-r1*2, h], center=true);
}
for(r=[0, 90, 180, -90])
rotate([0, 0, r])
translate([-size2/2, size1/2, 0])
rotate([-45, 0, 0])
cube([size2, 100, 2*h]);
}
for(r=[0, 90, 180, -90])
rotate([0, 0, r])
translate([size1/2-r1, size1/2-r1])
cylinder(h=h, r1=r1, r2=r2);
}
}
module gf_bottom() {
union() {
square_rounded(size1=35.6, size2=37.2, r1=0.8, r2=1.6, h=0.8);
translate([0, 0, 0.8])
square_rounded(size1=37.2, size2=37.2, r1=1.6, r2=1.6, h=1.8);
translate([0, 0, 2.6])
square_rounded(size1=37.2, size2=41.5, r1=1.6, r2=3.75, h=2.15);
}
}
module gf_socker_cut() {
t = 0.25;
a = sin(45)*t;
b = a*tan(22.5);
c = t/sin(45);
echo(a+b);
translate([0, 0, -a])
union() {
square_rounded(size1=35.6+a*2, size2=37.2+2*t, r1=0.8+a, r2=1.6+t, h=0.8+b);
translate([0, 0, 0.8+b])
square_rounded(size1=37.2+2*t, size2=37.2+2*t, r1=1.6+t, r2=1.6+t, h=1.8);
translate([0, 0, 2.6+b])
square_rounded(size1=37.2+2*t, size2=41.5+2*c, r1=1.6+t, r2=3.75+c, h=2.15+a-b-0.001);
}
}
// gf_bottom();
// gf_socker_cut();
difference() {
union() {
gf_bottom();
translate([0, 0, 4.75])
square_rounded(size1=41.5, size2=41.5, r1=3.75, r2=3.75, h=HIEGHT*7+4.4-4.75);
}
translate([0, 0, HIEGHT*7+4.4])
gf_socker_cut();
}