This repository was archived by the owner on Jun 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebcam_18MP_enclosure.scad
More file actions
executable file
·123 lines (102 loc) · 2.98 KB
/
Copy pathwebcam_18MP_enclosure.scad
File metadata and controls
executable file
·123 lines (102 loc) · 2.98 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* Mount / enclosure for an 18MP Raspberry Pi camera
*
* Designed for 3D printing, long term use in growth chambers,
* and to protect the camera from jostling and cable issues.
*
* Contact: zac.hatfield.dodds@gmail.com
*/
// Currently maintained by Ming-Dao Chia
// (Ming-Dao.Chia@anu.edu.au)
$fn=128; // circles as n-sided shapes
/* Constants for parametric adjustment */
// XY size, z height
camXY = 31;
height = 45;
// height of enclosing walls
wallH = 20;
// width of surfaces (for strength and inset nut compatibility)
width = 4;
// dimensions of USB plug and cable to hold
usbW = 16.5;
usbD = 8.9;
cablediam = 5;
// width of bottom cutout and diam of lens hole (inc. spacing)
cutout = 6;
lens = 17;
// tripod mount size (slightly smaller to allow inset)
tripod=9-0.5;
// camera securing bar
screw=3+0.1;
depth=7;
// clip settings
display_thickness = 8;
clip_thickness = 2;
/* The actual design code */
//rotate([90,0,0]) // lay on back to print
translate([0,0,width])
difference() {
// Main brick to subtract from
translate([-width,-width,-width]) union(){
cube([camXY+2*width,camXY+2*width,height]);
}
//Cut off most of the top, except a post for the cable
difference(){
// main cutting cube
translate([-2*width,-2*width,wallH]) cube([camXY*2,camXY*2,height]);
// don't cut off back wall
translate([-width,-width,0]) cube([camXY*2,width,height]);
}
// cut out spaces for the silicon, lens, wires, etc
// keeping a lip at the front...
difference(){
cube([camXY,camXY+width+1,wallH+1]);
translate([0, camXY, 0]) cube([2*camXY, width+1, display_thickness-2]);
};
translate([(camXY-cutout)/2,0,-1-width]) cube([cutout,camXY,width+2]);
// lens has to go in at an angle
translate([camXY/2,camXY/2,-1-width]) hull(){
cylinder(d=lens,h=width+2);
translate([0, 6, 0])cylinder(d=lens,h=width+2);
};
// hole for tripod mount
translate([width,0.01,wallH+tripod])
rotate([90,0,0])
cylinder(d=tripod,h=width+1);
// hole for securing bar
translate([-(width+1),camXY,(wallH-depth+screw)])
rotate([0,90,0])
cylinder(d=screw,h=camXY*2);
};
// clip (round bit)
translate([camXY/2, camXY+width/2+tripod*3,display_thickness+0.7])
intersection(){
translate([0,0,-5])
cylinder(d=tripod,h=camXY*2);
difference(){
translate([-5,0,0])
rotate([0,90,0])
cylinder(d=tripod,h=camXY*2);
translate([-5,0,0])
rotate([0,90,0])
cylinder(d=tripod-5,h=camXY*2);
translate([-tripod,-tripod,-2])
cube([tripod*2,tripod*2,tripod*2]);
}
}
// clip (back)
translate([camXY/2-tripod/2,camXY+width/2,display_thickness])
rotate([-8,0,0])
cube([tripod, tripod*3, 2]);
// clip (front)
translate([camXY-tripod/1.9,camXY+width/2,0])
rotate([0,0,0])
cube([tripod, tripod, 2]);
translate([camXY-tripod/1.9,camXY+tripod+width/2,1])
rotate([0,90,0])
cylinder(d=2,h=tripod);
translate([-tripod/2.1,camXY+width/2,0])
rotate([0,0,0])
cube([tripod, tripod, 2]);
translate([-tripod/2.1,camXY+tripod+width/2,1])
rotate([0,90,0])
cylinder(d=2,h=tripod);