This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRPiCC_top.scad
executable file
·106 lines (94 loc) · 2.66 KB
/
RPiCC_top.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
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
95
96
97
98
99
100
101
102
103
104
105
106
// RPi Case Cover
// by Ming-Dao Chia
// for the Borevitz Lab, Australian National University
// Settings
lid_height = 6; // Total lid height, not including the little front tab
rounding = 2; // just for the cable tie slots (less = sharper corners)
circle_res = 20; // can increase for final export
// just the cover without holes
module baseCover(){
union(){
difference(){
translate([0,-2,0]) // slight shift to fit the thicker mounting flap
cube([64,95,lid_height]); // if case only, y=93
translate([2,2,2])
cube([60,89,lid_height]);
}
// front flap helps prevent unwanted sideways movement
translate([4,91,lid_height-2])
cube([55.6,2,5]);
}
}
// configurable hole for screws
module screwHole(diameter, x, y){
translate([x,y,-2])
cylinder(d=diameter, h=10, $fs=0.2);
}
// slots for ribbon wires
module cableSlot(xpos, ypos, xsize, ysize){
translate([xpos,ypos,-2])
cube([xsize,ysize,10]);
}
// rods to connect to case bottom
module baseMountingHoles(){
screwHole(3, 7.5, 7);
screwHole(3, 7.5, 65.5);
screwHole(3, 56.5, 7);
screwHole(3, 56.5, 65.5);
}
// larger 180 camera
module bigCamera(xpos,ypos){
screwHole(4, xpos,ypos);
screwHole(4, xpos+29,ypos);
screwHole(4, xpos,ypos+29);
screwHole(4, xpos+29,ypos+29);
}
// fits standard RPi camera
module smallCamera(xpos,ypos){
screwHole(3,xpos,ypos);
screwHole(3,xpos+21,ypos);
screwHole(3,xpos,ypos+13);
screwHole(3,xpos+21,ypos+13);
}
// fits current temperature/humidity sensor
module tempHumiditySensor(xpos,ypos){
screwHole(3, xpos,ypos);
screwHole(3, xpos,ypos-15);
screwHole(3,xpos-27,ypos-7.5);
}
// Generic rounded rectangle module, from the bottom
module sidePort(x,y, rounding=rounding){
rotate([0,0,0])
minkowski()
{
cube([y-rounding*2,x-rounding*2,1],center=true);
cylinder(r=rounding,h=5, $fn=circle_res);
}
}
// Holes for cable ties
module cableTiePort(x,y){
translate([x,y,-2])
sidePort(12,4.2);
}
difference(){
baseCover(); // everything is subtracted from this
// Fits RPi screws
baseMountingHoles();
// camera ribbon cable
cableSlot(10,50,25,2);
bigCamera(10,14);
smallCamera(10,24);
tempHumiditySensor(40,84.5);
// humidity sensor cable
cableSlot(54,73,6,9);
// cable ties to secure top and bottom
cableTiePort(6,55);
cableTiePort(58,55);
rotate([0,0,90])
cableTiePort(6,-48);
// allows slot for other side of case
translate([15,-2.1,-1])
cube([26,4.2,lid_height+2]);
}
// uncommment to import other half for debugging
//translate([64,0,37]) rotate([0,180,0]) import("RPiCC_bottom.stl");