-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsevensegplate.scad
115 lines (95 loc) · 2.33 KB
/
sevensegplate.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
// OpenSCAD LED neon 7 segment display plate
//
// A plate with slots for pieces of LED neon
// as segments of a 7-segment display
//
// ATTENTION:
// This is not a classic LEDneon frame and
// DOES *NOT* USE THE CENTRAL CONFIG FILE
/////////////////////////////////////////////////////////
//Height of a single vertical segment
segh = 50;
//Width of a horizontal segment
segw = 50;
//Thickness of lines of the segment
//i.e., LED neon tape width
segt = 5;
//Gap between segments
segg = 5;
//Depth of the slots
segd = 6;
//Hole offset horizontal
hoh = 25;
//Hole offset vertical
hov = 25;
//Floor height
fl = 2.4;
//Slot wall thickness
wt = 1.2;
//Border top and bottom
btb = 5;
//Border left and right
blr = 5;
///////////////////////////
//Prevent planefighting
pf = 0.01;
sh=segh+2*wt;
sw=segw+2*wt;
st=segt+2*wt;
totalw = 2*blr+st+sw+2*segg;
totalh = 2*btb+st+2*sh+4*segg;
totald = segd+fl;
echo("Overall size");
echo(str("Total width: ", totalw));
echo(str("Total height: ", totalh));
echo(str("Total depth: ", totald));
// mode = 0: generate slots
// mode = 1: generate holes
module onesegh(mode=0) {
if(mode==0) {
difference() {
cube([segw+2*wt, segt+2*wt, segd+fl]);
translate([wt,wt,fl])
cube([segw, segt, segd+pf]);
}
} else {
translate([wt+hoh-segt/2,wt,-pf])
cube([segt, segt, fl+2*pf]);
}
}
module onesegv(mode=0) {
if(mode==0) {
difference() {
cube([segt+2*wt, segh+2*wt, segd+fl]);
translate([wt,wt,fl])
cube([segt, segh, segd+pf]);
}
} else {
translate([wt,wt+hov-segt/2,-pf])
cube([segt, segt, fl+2*pf]);
}
}
module sevensegplate(mode=0) {
translate([segg,-st/2,0])
onesegh(mode=mode);
translate([-st/2,segg,0])
onesegv(mode=mode);
translate([segg,sh+2*segg-st/2,0])
onesegh(mode=mode);
translate([-st/2,sh+3*segg,0])
onesegv(mode=mode);
translate([segg,2*sh+4*segg-st/2,0])
onesegh(mode=mode);
translate([sw+2*segg-st/2,segg,0])
onesegv(mode=mode);
translate([sw+2*segg-st/2,sh+3*segg,0])
onesegv(mode=mode);
if(mode==0) {
translate([-st/2-blr,-st/2-btb,0])
cube([totalw,totalh,fl-pf]);
}
}
difference() {
sevensegplate(mode=0);
sevensegplate(mode=1);
}