-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsensor_case_light.scad
More file actions
114 lines (108 loc) · 2.25 KB
/
sensor_case_light.scad
File metadata and controls
114 lines (108 loc) · 2.25 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
include <lib/rj45_case.scad>
include <conf/config.scad>
x=58;
x1=0;
y1=25;
y2=y1;
z1=19;
z2=z1;
//default action PRINT or RENDER
/* ACTION=RENDER; */
ACTION=PRINT;
module part(cutout=NONE) {
translate([0,0,0]){
//part to cut as holes in the bottom case
if (cutout==BOTTOM) {
translate([50-w+1, -y2, 5+w]) {
cube(size=[20, y2*2, z2+w], center=false);
}
}
else if (cutout==TOP) {
//part to cut as holes in the top case
translate([-5, 0, 0]) {
rj45();
}
translate([50-w+1+w, -y2, 5+w*2]) {
cube(size=[20, y2*2, z2+w], center=false);
}
} else {
//part to add to the case
difference() {
translate([10-w, 0, 0]) {
grove_rj45();
}
translate([-8, -5, 0]) {
cube(size=[5, 10, 10]);
}
}
translate([50-w, 0, 0]) {
grove_module_holder();
%grove_module(flat=0,pos=0,block=0);
}
}
}
}
module cover_bottom() {
/* render() */
translate([-4-w, -y2/2-w, 0]) {
difference() {
cube(size=[15+w*2, y2+w*2, z2-5]);
translate([w+5, -w, w]) {
cube(size=[15+w*2, y2+w*4, z2-5]);
}
translate([x1+w*4, y2+w*3, z2-5+w]) {
rotate([0, 30, 180]) {
cube(size=[x1+w*5, y2+w*4, w*2]);
}
}
translate([0, w, -f]) {
hull() {
cube(size=[5, y2, z2-5-w+f]);
translate([-w, 0, w]) {
cube(size=[5, y2, z2-5-w+f*2]);
}
}
}
hull() {
translate([8-w*2, y2/2-w+1, -f]) {
cube(size=[5, 7, w]);
translate([w, -w*2, w]) {
cube(size=[5+w*2, 7+w*4, w]);
}
}
}
translate([4+w, y2/2+w, 0]) {
translate([10, 0, 0]) {
cylinder(d=2.5, h=10, center=true,$fn=12);
}
}
}
}
}
module assembly() {
box_bottom();
translate([50-w,0,5+w]){
cover_bottom();
}
translate([-w, 0, -w]) {
%box_top();
}
box_holder();
}
module print() {
/* render() */
{
box_bottom();
translate([y2, y1*1.5, 0]) {
rotate([0, -90, 0]) {
box_top();
}
}
translate([y2*2, y1*1.5, -3+w]) {
cover_bottom();
}
translate([0, -y1*1.5, 5+w]) {
box_holder();
}
}
}