-
Notifications
You must be signed in to change notification settings - Fork 0
/
Construx.scad
121 lines (106 loc) · 2.83 KB
/
Construx.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
$fn=180;
bl = 17.85;
kl = 12;
ft = 2.1;
function beamLength(s) = bl*s + (s-1)*kl;
function innerLength(s) = beamLength(s) - 2*ft;
module knob(){
difference(){
union(){
cylinder(4.1, d=6, true) ;
translate([-3,-3,2.4])
minkowski(){
cube([6,6,1.8]);
cylinder(.1,r=.925);
}
};
cylinder(5, d=4.1, true);
};
}
module face(){
translate([0,6,6])
rotate([0,90,0])
difference(){
translate([-6,-6,0])cube([kl,kl,ft]);
translate([-6,-3,0])cube([.75,6,ft]);
translate([-3,-6,0])cube([6,.75,ft]);
translate([-3,5.25,0])cube([6,.75,ft]);
translate([6,-3.1,0])hull(){
cube([.1,6.2,ft]);
translate([-4.65,.15,0])cube([.1,5.9,ft]);
};
cylinder(ft,d=6.7,true);
translate([-3.35,0,0])cylinder(ft,d=1.5,true);
};
}
module support(){
difference(){
cube([.5,kl,kl]);
translate([0,kl*.5,kl*.5])rotate([0,90,0])cylinder(h=1, d=kl*.5);
translate([0,kl*.25,0])cube([.5,kl*.5,kl*.5]);
}
}
module innerBeam(il){
difference(){
cube([il,kl,kl]);
translate([0,1.3,0])cube([il,9.4,9.4]);
};
}
module beam(segments){
il = innerLength(segments);
translate([ft,0,0]) innerBeam(il);
translate([il+ft,0,0])face();
face();
if(segments >1){
z = ceil(segments/2);
c = ceil((segments+2)/2);
d = (il + ft*2)/c;
for(i = [1:z]){
translate([i*d -.25,0,0])support();
}
}
}
module rectPanel(xs,ys){
xl = beamLength(xs)-.2;
yl = beamLength(ys)-.2;
panelEdge(xs);
translate([xl,yl,0])rotate([0,0,180])panelEdge(xs);
translate([-1.5,0,0])cube([xl+3,yl,1]);
}
module edge(xl){
difference(){
cube([xl,1,4]);
translate([0,0,3])rotate([45,0,0])cube([xl,2,2]);
}
}
module panelEdge(xs){
xl = beamLength(xs)-.2;
oa = 1.45;
ia = 3.65;
gap = 8.70;
cube([xl,1,4]);
translate([0,-1,3])
union(){
for(i = [1:xs]){
if (i == 1){
edge(bl+oa);
} else if(i == xs){
translate([((bl+oa)+((i-2)*(bl+3.45))+ gap*(i-1)),0,0])edge(bl+oa);
} else {
translate([((bl+oa)+((i-2)*(bl+3.45))+ gap*(i-1)),0,0])edge(bl+ia);
}
}
translate([0,0,2])rotate([0,90,0])cylinder(1,d=2);
translate([xl-1,0,2])rotate([0,90,0])cylinder(1,d=2);
}
translate([0,0,4])
difference(){
cube([2,1,3]);
translate([0,1,0])rotate([18,0,0])cube([2,1,4]);
}
translate([xl-2,0,4])
difference(){
cube([2,1,3]);
translate([0,1,0])rotate([18,0,0])cube([2,1,4]);
}
}