screws.scad
2.61 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
module screw6x50() {
color("#ccc") translate([0,0,0]) {
cylinder(d=0.58,h=5, $fn=10);
translate([0,0,-screwhead]) {
cylinder(d=1.2,h=screwhead,$fn=6);
}
}
}
module nut() {
color("#aaa") cylinder(d=1.2,h=nutheight,$fn=6);
}
module shim() {
color("#eee") cylinder(d=shimdiameter,h=shimheight);
}
module shimSpring(locked) {
if ( locked == 1 ) {
color("#0f0") cylinder(d=shimdiameter,h=locked+0.5);
} else {
color("#f00") cylinder(d=shimdiameter,h=locked+0.5);
}
}
module removableshimblock() {
/* shimblockHeight; */
/* color("#eee") cylinder(d=1.3,h=0.1); */
}
module cornerscrew( z, upside=false ) {
translate([0,0,0]) screw6x50();
shim();
if ( upside == true ) {
translate([ 0, 0, shimheight + strength ]) { shim();
/************ GRATE ************/
translate([ 0, 0, shimheight ]) { nut();
translate([ 0, 0, 1.26]) { nut();
translate([ 0, 0, nutheight]) { shim();
/************ NEXT BOX ************/
translate([ 0, 0, shimheight+2*strength + 0.1 ]) { nut();
translate([ 0, 0, nutheight]) rotate([0,0,40]) nut();
}}}}}
} else {
/************ NEXT BOX ************/
translate([ 0, 0, shimheight +strength*2 + 0.1]) { nut();
translate([ 0, 0, 1.54 ]) { nut();
/************ GRATE ************/
translate([ 0, 0, strength + nutheight ]) rotate([0,0,23]) {nut();
translate([ 0, 0, nutheight]) rotate([0,0,20]) nut();
}}}
}
}
module hinges(locked) {
rotation = locked ? 90 : 0;
translate([0,0,0.1]) cube([1.4,0.07,0.8]);
rotate([0,90,0]) translate([-0.1,0,0]) cylinder(r=0.04, h=1.4, $fn=7);
translate([0,0,0.1]) rotate([rotation,0,0])
translate([0,-0.1,0]) cube([1.4,0.07,0.8]);
/* } */
}
module cornerscrews(z, locked) {
shift = locked ? 0 : 2;
translate([2.4 + shift
, 0.8
, z - 2.66
])
cornerscrew(z,upside=true);
translate([0.8
, 2.4 + shift
, recess + strength + shimheight
]) rotate([180,0,0])
cornerscrew(z,upside=false);
translate([gratesize,gratesize,recess+strength]) {
translate([1.3,0,0]) hinges(locked);
rotate([0,0,90]) translate([2.8,0,0]) rotate([0,0,180])hinges(locked);
}
}
module screws(x,y,z, locked) {
cornerscrews(22,locked);
mirror([0,1,0]) translate([0,-y,0]) cornerscrews(22, locked);
mirror([1,0,0]) translate([-x,0,0]) cornerscrews(22, locked);
mirror([1,0,0]) translate([-x,y,0]) mirror([0,1,0]) cornerscrews(22, locked);
}