forked from hominoids/SBC_Model_Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsbc_models.scad
executable file
·233 lines (217 loc) · 8.88 KB
/
sbc_models.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/*
SBC Models Copyright 2016,2017,2018,2019,2020,2021,2022 Edward A. Kisiel hominoid@cablemi.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
20190214 Version 1.0.0 SBC Model Framework
20190218 Version 1.0.1 Added HK Odroid-N2 as "n2"
20200425 Version 1.0.2 Added AtomicPi as "atomicpi"
Added Nvidia JetsonNano as "jetsonnano"
Updated Odroid-N2 sbc data
Updated Odroid-H2 sbc data
Added Odroid-C4 as"c4"
Added oem heatsinks
Added Odroid-XU4Q as "xu4q"
20200725 Version 1.0.3 Added Odroid-N2+ and heatsink
20201021 Version 1.0.4 Added HK Odroid-HC4 as "hc4"
20220202 Version 1.0.5 Added HK Show2 as "show2"
20220413 Version 1.0.6 Added Odroid-M1 as "m1"
20220515 Version 1.0.7 Added rockpro64, jetsonnano, updated sbc_test.scad, sbc_test_components.scad
and other fixes and adjustments
20221020 Version 1.0.8 rpizero,rpizero2w,rpi1a+,rpi1b+,rpi3a+,rpi3b,rpi3b+,rpi4b,rockpi4b+,
rockpi4c,rockpi4c+,rockpi5b,vim1,vim2,vim3l,vim3,vim4,
tinkerboard,tinkerboard-s,tinkerboard-2,tinkerboard-r2
rock64,quartz64a,quartz64b,h64b,opizero,opizero2,opir1plus_lts
20221101 Version 1.0.9 added h3/h3+ as h3, rockpi5b adjustments
20221207 Version 1.0.10 added n2l and n2lq
2023xxxx Version 1.0.xx added star64, licheerv+dock, visionfive2
see https://github.com/hominoids/SBC_Case_Builder
USE: sbc(model)
model = "c1+","c2","c4","xu4","xu4q","mc1","hc1","hc4","m1","n1","n2","n2l","n2lq","n2+","h2","show2"
"rpizero","rpizero2w","rpi1a+","rpi1b+","rpi3a+","rpi3b","rpi3b+","rpi4b",
"jetsonnano","rock64","rockpro64","quartz64b","quartz64b,"h64b","star64"
"rockpi4b+","rockpi4c","rockpi4c+","rockpi5b",
"vim1","vim2","vim3l","vim3","vim4",
"tinkerboard","tinkerboard-s","tinkerboard-2","tinkerboard-r2",
"opizero","opizero2","opir1plus_lts",
"licheerv+dock",
"visionfive2"
*/
include <./sbc_models.cfg>
use <./sbc_library.scad>
module sbc(model) {
sbc_model = [model];
s = search(sbc_model,sbc_data);
$fn=90;
// pcb and holes
// pcbsize_x, pcbsize_y, pcbsize_z, pcbcorner_radius, topmax_component_z, bottommax_component_z
pcbsize_x = sbc_data[s[0]][1];
pcbsize_y = sbc_data[s[0]][2];
pcbsize_z = sbc_data[s[0]][3];
pcbcorner_radius = sbc_data[s[0]][4];
difference() {
color("tan") pcb([pcbsize_x,pcbsize_y,pcbsize_z], pcbcorner_radius);
// pcb mounting holes
for (i=[7:3:36]) {
pcb_hole_x = sbc_data[s[0]][i];
pcb_hole_y = sbc_data[s[0]][i+1];
pcb_hole_size = sbc_data[s[0]][i+2];
if (pcb_hole_x!=0 && pcb_hole_y!=0) {
translate([pcb_hole_x,pcb_hole_y,-1])
color("tan") cylinder(d=pcb_hole_size, h=5);
}
}
}
// soc placement
// soc1size_x, soc1size_y, soc1size_z, soc1loc_x, soc1loc_y, soc1loc_z, soc1_rotation, "soc1_side"
for (i=[37:8:68]) {
soc1size_x = sbc_data[s[0]][i];
soc1size_y = sbc_data[s[0]][i+1];
soc1size_z = sbc_data[s[0]][i+2];
soc1loc_x = sbc_data[s[0]][i+3];
soc1loc_y = sbc_data[s[0]][i+4];
soc1loc_z = sbc_data[s[0]][i+5];
soc1_rotation = sbc_data[s[0]][i+6];
soc1_side = sbc_data[s[0]][i+7];
if (soc1size_x!=0 && soc1size_y!=0) {
if (soc1_side == "top" ) {
color("dimgray",1)
translate([soc1loc_x,soc1loc_y,pcbsize_z])
rotate([0,0,-soc1_rotation])
cube([soc1size_x,soc1size_y,soc1size_z]);
}
if (soc1_side == "bottom") {
color("dimgray",1)
translate([soc1loc_x,soc1loc_y,-pcbsize_z])
rotate([0,0,soc1_rotation])
cube([soc1size_x,soc1size_y,soc1size_z]);
}
}
}
// component placement loc_x, loc_y, rotation, "side", "type"
for (i=[69:6:len(sbc_data[s[0]])]) {
loc_x = sbc_data[s[0]][i];
loc_y = sbc_data[s[0]][i+1];
rotation = sbc_data[s[0]][i+2];
side = sbc_data[s[0]][i+3];
class = sbc_data[s[0]][i+4];
type = sbc_data[s[0]][i+5];
if (class == "memory") {
if (loc_x!=0 || loc_y!=0) {
memory(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "switch") {
if (loc_x!=0 || loc_y!=0) {
switch(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "button") {
if (loc_x!=0 || loc_y!=0) {
button(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "plug") {
if (loc_x!=0 || loc_y!=0) {
plug(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "usb2") {
if (loc_x!=0 || loc_y!=0) {
usb2(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "usb3") {
if (loc_x!=0 || loc_y!=0) {
usb3(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "usbc") {
if (loc_x!=0 || loc_y!=0) {
usbc(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "network") {
if (loc_x!=0 || loc_y!=0) {
network(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "video") {
if (loc_x!=0 || loc_y!=0) {
video(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "fan") {
if (loc_x!=0 || loc_y!=0) {
fan(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "gpio") {
if (loc_x!=0 || loc_y!=0) {
gpio(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "audio") {
if (loc_x!=0 || loc_y!=0) {
audio(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "storage") {
if (loc_x!=0 || loc_y!=0) {
storage(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "combo") {
if (loc_x!=0 || loc_y!=0) {
combo(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "jumper") {
if (loc_x!=0 || loc_y!=0) {
jumper(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "ic") {
if (loc_x!=0 || loc_y!=0) {
ic(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "misc") {
if (loc_x!=0 || loc_y!=0) {
misc(loc_x,loc_y,rotation,side,type,pcbsize_z);
}
}
if (class == "heatsink") {
if (loc_x!=0 || loc_y!=0) {
heatsink(loc_x,loc_y,rotation,side,type,pcbsize_z,sbc_data[s[0]][39]);
}
}
if (class == "pcie") {
if(loc_x!=0 || loc_y!=0) {
pcie(loc_x, loc_y, rotation, side, type, pcbsize_z);
}
}
if (class == "jst_ph") {
if(loc_x!=0 || loc_y!=0) {
jst_ph(loc_x, loc_y, rotation, side, type, pcbsize_z);
}
}
if (class == "cm_holder") {
if(loc_x!=0 || loc_y!=0) {
cm_holder(loc_x, loc_y, rotation, side, type, pcbsize_z);
}
}
if (class == "cm") {
if(loc_x!=0 || loc_y!=0) {
cm(loc_x, loc_y, rotation, side, type, pcbsize_z);
}
}
}
}