-
Notifications
You must be signed in to change notification settings - Fork 0
/
tamagucci-shell.scad
176 lines (143 loc) · 3.85 KB
/
tamagucci-shell.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// import("file.svg");
frontShell();
module frontShell() {
difference() {
frontShellWithoutHoles();
frontHoles();
}
}
module frontShellWithoutHoles() {
difference() {
union(){
linear_extrude(15){
translate([0, 0, 0]) {
square(size=[150, 70], center=true);
}
}
}
v = 2;
union(){
translate([v/2, v/2, 0.1]) {
linear_extrude(15){
square(size=[150-v*2, 70-v*2], center=true);
}
}
}
}
}
module frontHoles() {
translate([0, 0, -0.1]) {
linear_extrude(10){
color([0/255, 0/255, 0/255]) {
dpadHole(60,15);
ssButtonHole(60,-20);
gameButtonHole(-60,10);
speakerHoles(-60,-20);
screenHole();
}
}
}
}
module hsLogo(x,y) {
translate([x, y, 0]) {
linear_extrude(height=10, center=true, convexity=10, twist=0) {
import("Icon_green_transparent.svg");
}
}
}
module dpadHole(xPos,yPos) {
d = 20; //not acurate number
translate([xPos, yPos, 0]) {
circle(r=d/2);
}
}
module ssButtonHole(x,y) {
x = x-2; //just to prettify. is bad code.
d=6; //depth
w=10; //heigth
xDist = 0; // dist between buttons.
yDist = 8;
translate([x, y, 0]) {
union(){
circle(r=d/2, $fn=20);
translate([w-d, 0, 0]) {
circle(r=d/2, $fn=20);
}
translate([w/2 - d/2, 0, 0]) {
square(size=[w-d, d], center=true);
}
}
}
translate([x+xDist, y+yDist, 0]) {
union(){
circle(r=d/2, $fn=20);
translate([w-d, 0, 0]) {
circle(r=d/2, $fn=20);
}
translate([w/2 - d/2, 0, 0]) {
square(size=[w-d, d], center=true);
}
}
}
}
module speakerHoles(xPos,yPos) {
d=1; //diameter of lines
l = 20; //mex length of diagonale in lines
r = 37; //positive verdier.
translate([xPos, yPos, 0]) {
rotate([0, 0, r]) {
union(){
speakerHOleLine(d,l);
//not geometrically parametric
per = 0.7;
translate([-cos(r), sin(r)+2*d, 0])
speakerHOleLine(d,l*per);
translate([+cos(r), -sin(r)-2*d, 0])
speakerHOleLine(d,l*per);
per2 = 0.4;
translate([-2*cos(r), 2*sin(r)+4*d, 0])
speakerHOleLine(d,l*per2);
translate([2*cos(r), -2*sin(r)-4*d, 0])
speakerHOleLine(d,l*per2);
}
}
}
}
module speakerHOleLine(d,l) {
union(){
translate([(-l+d)/2, 0, 0]) {
circle(r=d/2, $fn=15);
}
translate([(l-d)/2, 0, 0]) {
circle(r=d/2, $fn=15);
}
square(size=[l-d, d], center=true);
}
}
module gameButtonHole(xPos,yPos) {
d = 10; //not acurate number //diameter
xDist = 15; //not acurate number
yDist = 20; //not acurate number
res = 30; //resolution of circle (polygon count)
// translate([xPos, yPos, 0]) {
// circle(r=2); //centre pos
// }
translate([xPos+xDist/2, yPos, 0]) {
circle(r=d/2 , $fn=res); //a
}
translate([xPos-xDist/2, yPos, 0]) {
circle(r=d/2 , $fn=res); //y
}
translate([xPos, yPos+yDist/2, 0]) {
circle(r=d/2 , $fn=res); //x
}
translate([xPos, yPos-yDist/2, 0]) {
circle(r=d/2 , $fn=res); //b
}
}
module screenHole() {
wScreen = 85;
hScreen = 56;
//skjerm
square(size=[wScreen, hScreen], center=true);
}