-
Notifications
You must be signed in to change notification settings - Fork 1
/
fxbox.scad
102 lines (94 loc) · 1.49 KB
/
fxbox.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
holes = "designs/holes-2-upper.svg";
front_design = "designs/vector/vector-front.svg";
back_design = "designs/vector/vector-back.svg";
box_base = "cad/fxbox-box.stl";
lid_base = "cad/fxbox-lid.stl";
design = false;
lid = false;
bed_center = [125, 105];
offset = 40;
module box()
{
difference()
{
translate([0,0,1.1*25.4])
scale([1,1,-1])
import(box_base, convexity=3);
translate([0,0,-0.1])
linear_extrude(height = 25, center = false, convexity = 10)
{
translate([ -2.35/2.0*25.4, -4.0/2.0*25.4 ])
import(file = holes);
}
}
}
module lid()
{
translate([0,0,0.15*25.4])
import(lid_base, convexity=3);
}
module back_graphics()
{
translate([0,0,-0.1])
color([0.25,0.25,0.25])
linear_extrude(height = 0.3, center = false, convexity = 25)
{
translate([ -2.35/2.0*25.4, -4.0/2.0*25.4 ])
import(file = back_design);
}
}
module front_graphics()
{
translate([0,0,-0.1])
color([0.25,0.25,0.25])
linear_extrude(height = 0.3, center = false, convexity = 25)
{
translate([ -2.35/2.0*25.4, -4.0/2.0*25.4 ])
import(file = front_design);
}
}
translate(bed_center)
if(lid)
{
translate([-offset, 0, 0])
if(design)
{
scale([-1,1,1])
intersection()
{
back_graphics();
lid();
}
}
else
{
scale([-1,1,1])
difference()
{
lid();
back_graphics();
}
}
}
else
{
translate([offset, 0, 0])
if(design)
{
scale([-1,1,1])
intersection()
{
front_graphics();
box();
}
}
else
{
scale([-1,1,1])
difference()
{
box();
front_graphics();
}
}
}