forked from KitWallace/openscad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
triple-archway.scad
45 lines (40 loc) · 919 Bytes
/
triple-archway.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
module s (x,y,r) {
union() {
intersection () {
translate([x,y,0]) circle(r);
translate([-x,y,0]) circle(r);
}
translate([0,y/2,0]) square(size=[2 *(r-x), y],center=true);
}
}
module door(x,y,r,d) {
linear_extrude(height=d) s(x,y,r);
};
module arch(x,y,r,d,t) {
translate([0,-1,0])
difference () {
door(x,y,r+t,d);
translate([0,0,-1]) door(x,y,r,d+2*t + 2);
}
}
module archway (x,y,r,d,t,n) {
union() {
for (i=[0:n-1]) {
arch(x,y,r+i*t,d+i*t,t);
}
}
}
module triple_arch(x,y,r,d,t,n,dy,dn) {
assign(offset = r + x + (n + dn -1) * t) {
echo(offset);
union() {
archway(x,y,r,d,t,n);
translate([offset,0,0]) archway(x,y+dy,r,d,t,n+dn);
translate([-offset,0,0]) archway(x,y+dy,r,d,t,n+dn);
}
}
}
difference() {
triple_arch(4,7,8,3,1,4,-2,-2);
translate([0,-10,-2]) cube([100,20,100],center=true);
}