*Empty MediaWiki Message*
[stratum0-wiki.git] / Gesellschaftsspiel-Replikator%2FConnect_V1.mw
1 <pre>
2
3
4 // "Rivers, Roads and Rails" / "Contact" / "Connect"
5 // 2014-01-23 V1
6 // by Stratum 0
7 // License: WTF
8
9 $fn=20;
10 Kante=100;
11 Hoehe=4;
12 Kerbe=2;
13 RadiusA=Kante/4;
14 RadiusB=Kante*2/4;
15 RadiusC=Kante*3/4;
16 Strichdicke=8;
17 Kachelnummer=5;
18
19 if (Kachelnummer==1)
20 {
21 difference()
22 {
23 CreateTile("white");
24 translate ([Kante/2,Kante/2,0]) CreateArch(RadiusA,"red");
25 translate ([Kante/2,Kante/2,0]) CreateArch(RadiusB,"black");
26 translate ([Kante/2,Kante/2,0]) CreateArch(RadiusC,"blue");
27 }
28 };
29
30
31 if (Kachelnummer==2)
32 {
33 difference()
34 {
35 CreateTile("white");
36 translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusA,"red");
37 translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusB,"black");
38 translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusC,"blue");
39 }
40 };
41
42 if (Kachelnummer==3)
43 {
44 difference()
45 {
46 CreateTile("white");
47 translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusA,"red");
48 translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusB,"black");
49 translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusC,"blue");
50 }
51 };
52
53
54 if (Kachelnummer==4)
55 {
56 difference()
57 {
58 CreateTile("white");
59 translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusA,"red");
60 translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusB,"black");
61 translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusC,"blue");
62 }
63 };
64
65
66 if (Kachelnummer==5)
67 {
68 translate ([-Kante/4,Kante/4,Hoehe-Kerbe]) CreateEnd(RadiusC,"blue");
69 difference()
70 {
71 CreateTile("white");
72 translate ([-Kante/2,-Kante/2,Hoehe-Kerbe]) CreateArch(RadiusA,"red");
73 translate ([-Kante/2,-Kante/2,Hoehe-Kerbe]) CreateArch(RadiusB,"black");
74
75 }
76 };
77
78
79
80
81 module CreateTile(myColor)
82 {
83 // Basisdomino erstellen
84 color(myColor) cube([Kante, Kante, Hoehe], center=true);
85 }; // End Module
86
87
88 module CreateArch(myRadius, myColor)
89 {
90 difference () // Innenkreis vom Außenkreis abziehen.
91 {
92 color (myColor)
93 cylinder(Hoehe, myRadius+Strichdicke, myRadius+Strichdicke, center=true, $fn=60);
94 cylinder(Hoehe, myRadius-Strichdicke, myRadius-Strichdicke, center=true, $fn=60);
95 }
96 };
97
98 module CreateEnd(myLane, myColor)
99 {
100 color(myColor) cube([Kante/2,Strichdicke*2, Hoehe], center=true);
101
102 };
103
104 </pre>
This page took 0.062445 seconds and 5 git commands to generate.