/* Workflow */ HeeksCAD verlinkt, um es nicht zu vergessen
[stratum0-wiki.git] / Gesellschaftsspiel-Replikator%2FScrabbleBrett.mw
1
2 [[Datei:Ein Viertel Scrabble-Brett.PNG|thumb|OpenSCAD Entwurf von einem Scrabble-Brett (ein Viertel)]]
3
4 <PRE>
5
6
7 // Scrabble Spielbrett
8 // (ein Viertel)
9 // 2014-05-15 V1.2
10 // by Stratum 0
11 // License: WTFPL
12
13 // $fn=20;
14
15 Kante = 14;
16 Kantenbreite = 1;
17 Hoehe = 4;
18 Randhoehe = 2;
19 Abstand=0;
20 Zaehler=1;
21 Viertelfeld=8;
22
23
24
25 //Hauptprogramm
26
27 intersection()
28 {
29 ViertelBrett();
30 cube ([Kante*(Viertelfeld+0.5), Kante*(Viertelfeld+0.5), Kante*(Viertelfeld+0.5)]);
31 }
32
33
34 module ViertelBrett()
35 {
36
37 for (i = [1:Viertelfeld])
38 {
39 for (j = [1:Viertelfeld])
40 {
41 translate([(Kante+Abstand)*i+Abstand,(Kante+Abstand)*j,0])
42 {
43 //Dreifacher Wortwert
44 if ((i==1) && (j==1)) { Feld("red"); Striche(3);}
45 if ((i==1) && (j==8)) { Feld("red"); Striche(3);}
46 if ((i==8) && (j==1)) { Feld("red"); Striche(3);}
47
48 //Doppelter Wortwert
49 if ((i==2) && (j==2)) { Feld("pink"); Striche(2);}
50 if ((i==3) && (j==3)) { Feld("pink"); Striche(2);}
51 if ((i==4) && (j==4)) { Feld("pink"); Striche(2);}
52 if ((i==5) && (j==5)) { Feld("pink"); Striche(2);}
53 if ((i==8) && (j==8)) { Feld("pink"); Striche(2);}
54
55 // Dreifacher Buchstabenwert
56 if ((i==2) && (j==6)) { Feld("blue"); Punkte(3);}
57 if ((i==6) && (j==2)) { Feld("blue"); Punkte(3);}
58 if ((i==6) && (j==6)) { Feld("blue"); Punkte(3);}
59
60 // Doppelter Buchstabenwert
61 if ((i==7) && (j==7)) { Feld("lightblue"); Punkte(2); }
62 if ((i==3) && (j==7)) { Feld("lightblue"); Punkte(2);}
63 if ((i==7) && (j==3)) { Feld("lightblue"); Punkte(2);}
64 if ((i==8) && (j==4)) { Feld("lightblue"); Punkte(2);}
65 if ((i==4) && (j==8)) { Feld("lightblue"); Punkte(2);}
66 if ((i==1) && (j==4)) { Feld("lightblue"); Punkte(2);}
67 if ((i==4) && (j==1)) { Feld("lightblue"); Punkte(2);}
68
69 // ansonsten normales Feld
70 Feld("lightgreen");
71 }
72 } // End For J
73 } // End For I
74
75
76 }
77
78 // Basisfeld erstellen
79 module Feld(Farbe)
80 {
81 difference()
82 {
83 cube([Kante, Kante, Hoehe+Randhoehe], center=false);
84
85 translate ([Kantenbreite,Kantenbreite,Hoehe-Randhoehe])
86 color (Farbe)
87 cube([Kante-Kantenbreite-Kantenbreite, Kante-Kantenbreite-Kantenbreite, Hoehe+Randhoehe], center=false);
88
89 };
90
91 }
92
93 module Punkte(AnzahlPunkte)
94 {
95 if (AnzahlPunkte==2)
96 {
97 translate ([Kante/3, Kante/3, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
98 translate ([Kante/3*2, Kante/3*2, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
99 }
100 if (AnzahlPunkte==3)
101 {
102 translate ([Kante/4, Kante/4, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
103 translate ([Kante/4*2, Kante/4*2, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
104 translate ([Kante/4*3, Kante/4*3, Hoehe-Randhoehe]) cylinder(Randhoehe/2,2,1, center=false);
105 }
106 }
107
108
109
110 module Striche(AnzahlStriche)
111 {
112 if (AnzahlStriche==2)
113 {
114 translate ([Kante/3-Kantenbreite/2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
115 translate ([Kante/3*2-Kantenbreite/2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
116 }
117 if (AnzahlStriche==3)
118 {
119 translate ([Kante/4, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
120 translate ([Kante/4*2, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
121 translate ([Kante/4*3, Kante/4, Hoehe-Randhoehe]) cube([Randhoehe/2,Kante/2,Randhoehe/2]);
122 }
123 }
124
125
126
127
128 </PRE>
This page took 0.054985 seconds and 5 git commands to generate.