-
Notifications
You must be signed in to change notification settings - Fork 16
/
uno_case_base_v1_2.scad
156 lines (146 loc) · 4.07 KB
/
uno_case_base_v1_2.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// ----------------------------------------------------------------------- LICENSE
// This "3D Printed Case for Arduino Uno, Leonardo" by Zygmunt Wojcik is licensed
// under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
// To view a copy of this license, visit
// http://creativecommons.org/licenses/by-sa/3.0/
// or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
include <uno_case_param_v1_2.scad>
//------------------------------------------------------------------------- MODULES
module pcbLeg() {
translate([0, 0, 0])
difference() {
cylinder(h = floorHeight + pcbPositionZ, r1=5.5/2, r2 = 4.5/2);
}
}
//------------------------------------------------------------------------- MAIN BLOCK
difference()
{
// ADD
union()
{
// Add Base
linear_extrude(height = height/2, convexity = 10)
minkowski()
{
square([width, wide], center = true);
circle(roundR);
}
}
// SUBSTRACT
union()
{
// Lift floor height
translate([0, 0, floorHeight])
{
// Cut Base hole
linear_extrude(height = height/2, convexity = 10)
minkowski()
{
square([width, wide], center = true);
circle(roundR - pillarSize);
}
// Cut upper block lock
difference() {
translate([0, 0, height/2 - floorHeight - blockLockSize]) {
cylinder(h = blockLockSize+gap, r=width);
}
translate([0, 0, height/2 - floorHeight - blockLockSize - gap*2]) {
linear_extrude(height = blockLockSize+gap*4, convexity = 10)
minkowski() {
square([width, wide], center=true);
circle(roundR - layerWidth*4);
}
}
}
// Cut x panels
for (i = [0 : 180 : 180])
rotate([0, 0, i])
translate([width/2 + roundR - pillarSize/2 - layerWidth*7, 0, 0])
{
// Cut X panel hole
translate([0, 0, height/2])
cube([pillarSize, sidePanelXWidth, height], center=true);
// Cut X, Y srew holes
for (i = [wide/2, -wide/2])
{
translate([-(roundR - pillarSize/2 - layerWidth*7), i, - floorHeight])
if (i>0)
{
rotate([0, 0, 45])
translate([screwHoleRoundR, 0, 0])
{
cylinder(h = height*2, r=screwExt/2, center=true);
cylinder(h = 5,
r1 = (screwHead + (screwHead - screwExt))/2,
r2 = screwExt/2, center=true);
}
}
else
{
rotate([0, 0, -45])
translate([screwHoleRoundR, 0, 0])
{
cylinder(h = height*2, r=screwExt/2, center=true);
cylinder(h = 5,
r1 = (screwHead + (screwHead - screwExt))/2,
r2 = screwExt/2, center=true);
}
}
}
}
// Cut Y panels
for (i = [90 : 180 : 270])
rotate([0, 0, i])
translate([wide/2 + roundR - pillarSize/2 - layerWidth*7, 0, 0])
{
// Cut Y panel hole
translate([0, 0, height/2])
cube([pillarSize, sidePanelYWidth, height], center=true);
}
// Cut USB and Power holes
// translate to pcb position
translate([-pcbPositionX, -pcbWide/2, pcbPositionZ + pcbHeight])
{
// cut power hole
translate([0, powerJackPosition, (powerJackHeight-2)/2])
cube([10, powerJackWide, powerJackHeight], center=true);
// cut usb hole
translate([0, usbHolePosition, (usbHeight-2)/2])
cube([10, usbWide, usbHeight], center=true);
}
}
}
}
//------------------------------------------------------------------------- ADD PCB LEGS
// Translate to pcbPositionX
translate([-pcbPositionX, -pcbWide/2, 0])
difference()
{
// ADD
union()
{
// Add pcb legs
for(i=[ [13.97, 2.54, 0],
[15.24, 50.8, 0],
[66.04, 35.56, 0],
[66.04, 7.62, 0] ])
{
translate(i)
pcbLeg();
}
// Add pcb holders
for(i=[ [13.97, 2.54, 0],
[15.24, 50.8, 0],
[66.04, 35.56, 0],
[66.04, 7.62, 0] ])
{
translate(i)
cylinder(h=floorHeight+pcbPositionZ+1.5, r=1.2);
}
}
// SUBSTRACT
union()
{
//
}
}