-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtslot.scad
28 lines (26 loc) · 1.36 KB
/
tslot.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Forked from Nathan Zadoks 2011 under GPLv2
module tslot(length,size=1,thickness=0.075,gap=0.25,center=false) {
start=thickness/sqrt(2);
color([0.5,0.5,0.5]) linear_extrude(height=length,center=center) difference(){
union(){
for(d=[0:3]) rotate([0,0,d*90]) polygon(points=[
[0,0], [0,start],[size/2-thickness-start,size/2-thickness],[gap/2,size/2-thickness],[gap/2,size/2],
[size/2,size/2],[size/2,gap/2],[size/2-thickness,gap/2],[size/2-thickness,size/2-thickness-start],[start,0]
]); square(gap+thickness,center=true);
} circle(r=gap/2,center=true,$fn=20);
}
}
module quadslot(length,size=1,thickness=0.075,gap=0.25,center=false) {
start=thickness/sqrt(2);
color([0.5,0.5,0.5]) linear_extrude(height=length,center=center) union() {
for (i=[0:3]) rotate([0,0,i*90]) translate([-size/2,size/2,0]) difference(){
union(){
for (d=[0:2]) rotate([0,0,d*90]) polygon(points=[
[0,0], [0,start],[size/2-thickness-start,size/2-thickness],[gap/2,size/2-thickness],[gap/2,size/2],
[size/2,size/2],[size/2,gap/2],[size/2-thickness,gap/2],[size/2-thickness,size/2-thickness-start],[start,0]
]); square(gap+thickness,center=true);
} circle(r=gap/2,center=true,$fn=20);
}
}
echo(length);
}