-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmatchbox-castle-DESKTOP-8G8CCHI.scad
54 lines (45 loc) · 1.58 KB
/
matchbox-castle-DESKTOP-8G8CCHI.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
UNIT = 25.4;
$fn=100;
castle();
module castle() {
spacing = UNIT;
for (a =[1:8]) translate([0,spacing*a,0]) wall();
for (a =[1:10]) translate([spacing,spacing*a,0]) fence();
for (a =[1:2]) translate([spacing*2,spacing*a,0]) gate();
for (a =[1:6]) translate([spacing*3,spacing*a,0]) roof(UNIT/2);
translate([spacing*4, 0, 0]) roof(10); //??????
translate([spacing*5, 0, 0]) tower(UNIT*0.91);
translate([spacing*6, 0, 0]) tower(UNIT*0.76);
}
module wall() {
difference() {
cube([UNIT/2, UNIT/4, UNIT/4]);
translate([UNIT/8,0,UNIT/8]) cube([UNIT/12, UNIT/4, UNIT/8]);
translate([UNIT*(7/24),0,UNIT/8]) cube([UNIT/12, UNIT/4, UNIT/8]);
}
}
module gate() {
difference() {
cube([UNIT/2, UNIT/4, UNIT/2]);
translate([UNIT/8,0,0]) cube([UNIT/4, UNIT/4, UNIT/5]);
translate([UNIT/4,UNIT/4,UNIT/5]) rotate([90,0,0])cylinder(UNIT/4, UNIT/8, UNIT/8);
}
}
module fence() {
difference() {
cube([UNIT/2, UNIT*(3/20), UNIT/4]);
translate([UNIT*(9/24),0,UNIT*(5/24)]) cube([UNIT/12, UNIT/4, UNIT/24]);
translate([UNIT*(5/24),0,UNIT*(5/24)]) cube([UNIT/12, UNIT/4, UNIT/24]);
translate([UNIT*(1/24),0,UNIT*(5/24)]) cube([UNIT/12, UNIT/4, UNIT/24]);
}
}
module tower(height) {
difference() {
opening_height = UNIT*0.17;
cube([UNIT*(3/10), UNIT*(3/10), height]);
translate([UNIT*(1/10),0,height-opening_height]) cube([UNIT*(1/10), UNIT*(3/10), opening_height]);
}
}
module roof(lenght) {
linear_extrude(lenght) polygon([[0,0],[UNIT/4,0],[UNIT/8,UNIT/8]]);
}