1 //------------------------------------------------
2 // LookUpTable
3 //------------------------------------------------
4 //
5 // LookUpTable for the MarchingCubes 33 Algorithm
6 // Version 0.2 - 13/07/2002
7 //
8 // Thomas Lewiner thomas.lewiner@polytechnique.org
9 // Math Dept, PUC-Rio
10 //
11 //________________________________________________
12 
13 
14 #ifndef _LOOKUPTABLE_H_
15 #define _LOOKUPTABLE_H_
16 
17 
18 
19 
20 
21 //_____________________________________________________________________________
22 // For each of the possible vertex states listed in this table there is a
23 // specific triangulation of the edge intersection points.  The table lists
24 // all of them in the form of 0-5 edge triples with the list terminated by
25 // the invalid value -1.  For example: case[3] list the 2 triangles
26 // formed when cube[0] and cube[1] are inside of the surface, but the rest of
27 // the cube is not.
28 //
29 // Cube description:
30 //         7 ________ 6           _____6__             ________
31 //         /|       /|         7/|       /|          /|       /|
32 //       /  |     /  |        /  |     /5 |        /  6     /  |
33 //   4 /_______ /    |      /__4____ /    10     /_______3/    |
34 //    |     |  |5    |     |    11  |     |     |     |  |   2 |
35 //    |    3|__|_____|2    |     |__|__2__|     | 4   |__|_____|
36 //    |    /   |    /      8   3/   9    /      |    /   |    /
37 //    |  /     |  /        |  /     |  /1       |  /     5  /
38 //    |/_______|/          |/___0___|/          |/_1_____|/
39 //   0          1        0          1
40 //
41 //-----------------------------------------------------------------------------
42 static const char cases[256][2] = {
43 /*   0:                          */  {  0, -1 },
44 /*   1: 0,                       */  {  1,  0 },
45 /*   2:    1,                    */  {  1,  1 },
46 /*   3: 0, 1,                    */  {  2,  0 },
47 /*   4:       2,                 */  {  1,  2 },
48 /*   5: 0,    2,                 */  {  3,  0 },
49 /*   6:    1, 2,                 */  {  2,  3 },
50 /*   7: 0, 1, 2,                 */  {  5,  0 },
51 /*   8:          3,              */  {  1,  3 },
52 /*   9: 0,       3,              */  {  2,  1 },
53 /*  10:    1,    3,              */  {  3,  3 },
54 /*  11: 0, 1,    3,              */  {  5,  1 },
55 /*  12:       2, 3,              */  {  2,  5 },
56 /*  13: 0,    2, 3,              */  {  5,  4 },
57 /*  14:    1, 2, 3,              */  {  5,  9 },
58 /*  15: 0, 1, 2, 3,              */  {  8,  0 },
59 /*  16:             4,           */  {  1,  4 },
60 /*  17: 0,          4,           */  {  2,  2 },
61 /*  18:    1,       4,           */  {  3,  4 },
62 /*  19: 0, 1,       4,           */  {  5,  2 },
63 /*  20:       2,    4,           */  {  4,  2 },
64 /*  21: 0,    2,    4,           */  {  6,  2 },
65 /*  22:    1, 2,    4,           */  {  6,  9 },
66 /*  23: 0, 1, 2,    4,           */  { 11,  0 },
67 /*  24:          3, 4,           */  {  3,  8 },
68 /*  25: 0,       3, 4,           */  {  5,  5 },
69 /*  26:    1,    3, 4,           */  {  7,  3 },
70 /*  27: 0, 1,    3, 4,           */  {  9,  1 },
71 /*  28:       2, 3, 4,           */  {  6, 16 },
72 /*  29: 0,    2, 3, 4,           */  { 14,  3 },
73 /*  30:    1, 2, 3, 4,           */  { 12, 12 },
74 /*  31: 0, 1, 2, 3, 4,           */  {  5, 24 },
75 /*  32:                5,        */  {  1,  5 },
76 /*  33: 0,             5,        */  {  3,  1 },
77 /*  34:    1,          5,        */  {  2,  4 },
78 /*  35: 0, 1,          5,        */  {  5,  3 },
79 /*  36:       2,       5,        */  {  3,  6 },
80 /*  37: 0,    2,       5,        */  {  7,  0 },
81 /*  38:    1, 2,       5,        */  {  5, 10 },
82 /*  39: 0, 1, 2,       5,        */  {  9,  0 },
83 /*  40:          3,    5,        */  {  4,  3 },
84 /*  41: 0,       3,    5,        */  {  6,  4 },
85 /*  42:    1,    3,    5,        */  {  6, 11 },
86 /*  43: 0, 1,    3,    5,        */  { 14,  1 },
87 /*  44:       2, 3,    5,        */  {  6, 17 },
88 /*  45: 0,    2, 3,    5,        */  { 12,  4 },
89 /*  46:    1, 2, 3,    5,        */  { 11,  6 },
90 /*  47: 0, 1, 2, 3,    5,        */  {  5, 25 },
91 /*  48:             4, 5,        */  {  2,  8 },
92 /*  49: 0,          4, 5,        */  {  5,  7 },
93 /*  50:    1,       4, 5,        */  {  5, 12 },
94 /*  51: 0, 1,       4, 5,        */  {  8,  1 },
95 /*  52:       2,    4, 5,        */  {  6, 18 },
96 /*  53: 0,    2,    4, 5,        */  { 12,  5 },
97 /*  54:    1, 2,    4, 5,        */  { 14,  7 },
98 /*  55: 0, 1, 2,    4, 5,        */  {  5, 28 },
99 /*  56:          3, 4, 5,        */  {  6, 21 },
100 /*  57: 0,       3, 4, 5,        */  { 11,  4 },
101 /*  58:    1,    3, 4, 5,        */  { 12, 15 },
102 /*  59: 0, 1,    3, 4, 5,        */  {  5, 30 },
103 /*  60:       2, 3, 4, 5,        */  { 10,  5 },
104 /*  61: 0,    2, 3, 4, 5,        */  {  6, 32 },
105 /*  62:    1, 2, 3, 4, 5,        */  {  6, 39 },
106 /*  63: 0, 1, 2, 3, 4, 5,        */  {  2, 12 },
107 /*  64:                   6,     */  {  1,  6 },
108 /*  65: 0,                6,     */  {  4,  0 },
109 /*  66:    1,             6,     */  {  3,  5 },
110 /*  67: 0, 1,             6,     */  {  6,  0 },
111 /*  68:       2,          6,     */  {  2,  6 },
112 /*  69: 0,    2,          6,     */  {  6,  3 },
113 /*  70:    1, 2,          6,     */  {  5, 11 },
114 /*  71: 0, 1, 2,          6,     */  { 14,  0 },
115 /*  72:          3,       6,     */  {  3,  9 },
116 /*  73: 0,       3,       6,     */  {  6,  5 },
117 /*  74:    1,    3,       6,     */  {  7,  4 },
118 /*  75: 0, 1,    3,       6,     */  { 12,  1 },
119 /*  76:       2, 3,       6,     */  {  5, 14 },
120 /*  77: 0,    2, 3,       6,     */  { 11,  3 },
121 /*  78:    1, 2, 3,       6,     */  {  9,  4 },
122 /*  79: 0, 1, 2, 3,       6,     */  {  5, 26 },
123 /*  80:             4,    6,     */  {  3, 10 },
124 /*  81: 0,          4,    6,     */  {  6,  6 },
125 /*  82:    1,       4,    6,     */  {  7,  5 },
126 /*  83: 0, 1,       4,    6,     */  { 12,  2 },
127 /*  84:       2,    4,    6,     */  {  6, 19 },
128 /*  85: 0,    2,    4,    6,     */  { 10,  1 },
129 /*  86:    1, 2,    4,    6,     */  { 12, 13 },
130 /*  87: 0, 1, 2,    4,    6,     */  {  6, 24 },
131 /*  88:          3, 4,    6,     */  {  7,  7 },
132 /*  89: 0,       3, 4,    6,     */  { 12,  9 },
133 /*  90:    1,    3, 4,    6,     */  { 13,  1 },
134 /*  91: 0, 1,    3, 4,    6,     */  {  7,  9 },
135 /*  92:       2, 3, 4,    6,     */  { 12, 20 },
136 /*  93: 0,    2, 3, 4,    6,     */  {  6, 33 },
137 /*  94:    1, 2, 3, 4,    6,     */  {  7, 13 },
138 /*  95: 0, 1, 2, 3, 4,    6,     */  {  3, 12 },
139 /*  96:                5, 6,     */  {  2, 10 },
140 /*  97: 0,             5, 6,     */  {  6,  7 },
141 /*  98:    1,          5, 6,     */  {  5, 13 },
142 /*  99: 0, 1,          5, 6,     */  { 11,  2 },
143 /* 100:       2,       5, 6,     */  {  5, 16 },
144 /* 101: 0,    2,       5, 6,     */  { 12,  7 },
145 /* 102:    1, 2,       5, 6,     */  {  8,  3 },
146 /* 103: 0, 1, 2,       5, 6,     */  {  5, 29 },
147 /* 104:          3,    5, 6,     */  {  6, 22 },
148 /* 105: 0,       3,    5, 6,     */  { 10,  2 },
149 /* 106:    1,    3,    5, 6,     */  { 12, 17 },
150 /* 107: 0, 1,    3,    5, 6,     */  {  6, 27 },
151 /* 108:       2, 3,    5, 6,     */  { 14,  9 },
152 /* 109: 0,    2, 3,    5, 6,     */  {  6, 34 },
153 /* 110:    1, 2, 3,    5, 6,     */  {  5, 39 },
154 /* 111: 0, 1, 2, 3,    5, 6,     */  {  2, 14 },
155 /* 112:             4, 5, 6,     */  {  5, 20 },
156 /* 113: 0,          4, 5, 6,     */  { 14,  5 },
157 /* 114:    1,       4, 5, 6,     */  {  9,  5 },
158 /* 115: 0, 1,       4, 5, 6,     */  {  5, 32 },
159 /* 116:       2,    4, 5, 6,     */  { 11, 10 },
160 /* 117: 0,    2,    4, 5, 6,     */  {  6, 35 },
161 /* 118:    1, 2,    4, 5, 6,     */  {  5, 41 },
162 /* 119: 0, 1, 2,    4, 5, 6,     */  {  2, 16 },
163 /* 120:          3, 4, 5, 6,     */  { 12, 23 },
164 /* 121: 0,       3, 4, 5, 6,     */  {  6, 37 },
165 /* 122:    1,    3, 4, 5, 6,     */  {  7, 14 },
166 /* 123: 0, 1,    3, 4, 5, 6,     */  {  3, 16 },
167 /* 124:       2, 3, 4, 5, 6,     */  {  6, 46 },
168 /* 125: 0,    2, 3, 4, 5, 6,     */  {  4,  6 },
169 /* 126:    1, 2, 3, 4, 5, 6,     */  {  3, 21 },
170 /* 127: 0, 1, 2, 3, 4, 5, 6,     */  {  1,  8 },
171 /* 128:                      7,  */  {  1,  7 },
172 /* 129: 0,                   7,  */  {  3,  2 },
173 /* 130:    1,                7,  */  {  4,  1 },
174 /* 131: 0, 1,                7,  */  {  6,  1 },
175 /* 132:       2,             7,  */  {  3,  7 },
176 /* 133: 0,    2,             7,  */  {  7,  1 },
177 /* 134:    1, 2,             7,  */  {  6, 10 },
178 /* 135: 0, 1, 2,             7,  */  { 12,  0 },
179 /* 136:          3,          7,  */  {  2,  7 },
180 /* 137: 0,       3,          7,  */  {  5,  6 },
181 /* 138:    1,    3,          7,  */  {  6, 12 },
182 /* 139: 0, 1,    3,          7,  */  { 11,  1 },
183 /* 140:       2, 3,          7,  */  {  5, 15 },
184 /* 141: 0,    2, 3,          7,  */  {  9,  2 },
185 /* 142:    1, 2, 3,          7,  */  { 14,  6 },
186 /* 143: 0, 1, 2, 3,          7,  */  {  5, 27 },
187 /* 144:             4,       7,  */  {  2,  9 },
188 /* 145: 0,          4,       7,  */  {  5,  8 },
189 /* 146:    1,       4,       7,  */  {  6, 13 },
190 /* 147: 0, 1,       4,       7,  */  { 14,  2 },
191 /* 148:       2,    4,       7,  */  {  6, 20 },
192 /* 149: 0,    2,    4,       7,  */  { 12,  6 },
193 /* 150:    1, 2,    4,       7,  */  { 10,  3 },
194 /* 151: 0, 1, 2,    4,       7,  */  {  6, 25 },
195 /* 152:          3, 4,       7,  */  {  5, 18 },
196 /* 153: 0,       3, 4,       7,  */  {  8,  2 },
197 /* 154:    1,    3, 4,       7,  */  { 12, 16 },
198 /* 155: 0, 1,    3, 4,       7,  */  {  5, 31 },
199 /* 156:       2, 3, 4,       7,  */  { 11,  9 },
200 /* 157: 0,    2, 3, 4,       7,  */  {  5, 34 },
201 /* 158:    1, 2, 3, 4,       7,  */  {  6, 40 },
202 /* 159: 0, 1, 2, 3, 4,       7,  */  {  2, 13 },
203 /* 160:                5,    7,  */  {  3, 11 },
204 /* 161: 0,             5,    7,  */  {  7,  2 },
205 /* 162:    1,          5,    7,  */  {  6, 14 },
206 /* 163: 0, 1,          5,    7,  */  { 12,  3 },
207 /* 164:       2,       5,    7,  */  {  7,  6 },
208 /* 165: 0,    2,       5,    7,  */  { 13,  0 },
209 /* 166:    1, 2,       5,    7,  */  { 12, 14 },
210 /* 167: 0, 1, 2,       5,    7,  */  {  7,  8 },
211 /* 168:          3,    5,    7,  */  {  6, 23 },
212 /* 169: 0,       3,    5,    7,  */  { 12, 10 },
213 /* 170:    1,    3,    5,    7,  */  { 10,  4 },
214 /* 171: 0, 1,    3,    5,    7,  */  {  6, 28 },
215 /* 172:       2, 3,    5,    7,  */  { 12, 21 },
216 /* 173: 0,    2, 3,    5,    7,  */  {  7, 10 },
217 /* 174:    1, 2, 3,    5,    7,  */  {  6, 41 },
218 /* 175: 0, 1, 2, 3,    5,    7,  */  {  3, 13 },
219 /* 176:             4, 5,    7,  */  {  5, 21 },
220 /* 177: 0,          4, 5,    7,  */  {  9,  3 },
221 /* 178:    1,       4, 5,    7,  */  { 11,  8 },
222 /* 179: 0, 1,       4, 5,    7,  */  {  5, 33 },
223 /* 180:       2,    4, 5,    7,  */  { 12, 22 },
224 /* 181: 0,    2,    4, 5,    7,  */  {  7, 11 },
225 /* 182:    1, 2,    4, 5,    7,  */  {  6, 42 },
226 /* 183: 0, 1, 2,    4, 5,    7,  */  {  3, 14 },
227 /* 184:          3, 4, 5,    7,  */  { 14, 11 },
228 /* 185: 0,       3, 4, 5,    7,  */  {  5, 36 },
229 /* 186:    1,    3, 4, 5,    7,  */  {  6, 44 },
230 /* 187: 0, 1,    3, 4, 5,    7,  */  {  2, 17 },
231 /* 188:       2, 3, 4, 5,    7,  */  {  6, 47 },
232 /* 189: 0,    2, 3, 4, 5,    7,  */  {  3, 18 },
233 /* 190:    1, 2, 3, 4, 5,    7,  */  {  4,  7 },
234 /* 191: 0, 1, 2, 3, 4, 5,    7,  */  {  1,  9 },
235 /* 192:                   6, 7,  */  {  2, 11 },
236 /* 193: 0,                6, 7,  */  {  6,  8 },
237 /* 194:    1,             6, 7,  */  {  6, 15 },
238 /* 195: 0, 1,             6, 7,  */  { 10,  0 },
239 /* 196:       2,          6, 7,  */  {  5, 17 },
240 /* 197: 0,    2,          6, 7,  */  { 12,  8 },
241 /* 198:    1, 2,          6, 7,  */  { 11,  7 },
242 /* 199: 0, 1, 2,          6, 7,  */  {  6, 26 },
243 /* 200:          3,       6, 7,  */  {  5, 19 },
244 /* 201: 0,       3,       6, 7,  */  { 14,  4 },
245 /* 202:    1,    3,       6, 7,  */  { 12, 18 },
246 /* 203: 0, 1,    3,       6, 7,  */  {  6, 29 },
247 /* 204:       2, 3,       6, 7,  */  {  8,  4 },
248 /* 205: 0,    2, 3,       6, 7,  */  {  5, 35 },
249 /* 206:    1, 2, 3,       6, 7,  */  {  5, 40 },
250 /* 207: 0, 1, 2, 3,       6, 7,  */  {  2, 15 },
251 /* 208:             4,    6, 7,  */  {  5, 22 },
252 /* 209: 0,          4,    6, 7,  */  { 11,  5 },
253 /* 210:    1,       4,    6, 7,  */  { 12, 19 },
254 /* 211: 0, 1,       4,    6, 7,  */  {  6, 30 },
255 /* 212:       2,    4,    6, 7,  */  { 14, 10 },
256 /* 213: 0,    2,    4,    6, 7,  */  {  6, 36 },
257 /* 214:    1, 2,    4,    6, 7,  */  {  6, 43 },
258 /* 215: 0, 1, 2,    4,    6, 7,  */  {  4,  4 },
259 /* 216:          3, 4,    6, 7,  */  {  9,  7 },
260 /* 217: 0,       3, 4,    6, 7,  */  {  5, 37 },
261 /* 218:    1,    3, 4,    6, 7,  */  {  7, 15 },
262 /* 219: 0, 1,    3, 4,    6, 7,  */  {  3, 17 },
263 /* 220:       2, 3, 4,    6, 7,  */  {  5, 44 },
264 /* 221: 0,    2, 3, 4,    6, 7,  */  {  2, 19 },
265 /* 222:    1, 2, 3, 4,    6, 7,  */  {  3, 22 },
266 /* 223: 0, 1, 2, 3, 4,    6, 7,  */  {  1, 10 },
267 /* 224:                5, 6, 7,  */  {  5, 23 },
268 /* 225: 0,             5, 6, 7,  */  { 12, 11 },
269 /* 226:    1,          5, 6, 7,  */  { 14,  8 },
270 /* 227: 0, 1,          5, 6, 7,  */  {  6, 31 },
271 /* 228:       2,       5, 6, 7,  */  {  9,  6 },
272 /* 229: 0,    2,       5, 6, 7,  */  {  7, 12 },
273 /* 230:    1, 2,       5, 6, 7,  */  {  5, 42 },
274 /* 231: 0, 1, 2,       5, 6, 7,  */  {  3, 15 },
275 /* 232:          3,    5, 6, 7,  */  { 11, 11 },
276 /* 233: 0,       3,    5, 6, 7,  */  {  6, 38 },
277 /* 234:    1,    3,    5, 6, 7,  */  {  6, 45 },
278 /* 235: 0, 1,    3,    5, 6, 7,  */  {  4,  5 },
279 /* 236:       2, 3,    5, 6, 7,  */  {  5, 45 },
280 /* 237: 0,    2, 3,    5, 6, 7,  */  {  3, 19 },
281 /* 238:    1, 2, 3,    5, 6, 7,  */  {  2, 21 },
282 /* 239: 0, 1, 2, 3,    5, 6, 7,  */  {  1, 11 },
283 /* 240:             4, 5, 6, 7,  */  {  8,  5 },
284 /* 241: 0,          4, 5, 6, 7,  */  {  5, 38 },
285 /* 242:    1,       4, 5, 6, 7,  */  {  5, 43 },
286 /* 243: 0, 1,       4, 5, 6, 7,  */  {  2, 18 },
287 /* 244:       2,    4, 5, 6, 7,  */  {  5, 46 },
288 /* 245: 0,    2,    4, 5, 6, 7,  */  {  3, 20 },
289 /* 246:    1, 2,    4, 5, 6, 7,  */  {  2, 22 },
290 /* 247: 0, 1, 2,    4, 5, 6, 7,  */  {  1, 12 },
291 /* 248:          3, 4, 5, 6, 7,  */  {  5, 47 },
292 /* 249: 0,       3, 4, 5, 6, 7,  */  {  2, 20 },
293 /* 250:    1,    3, 4, 5, 6, 7,  */  {  3, 23 },
294 /* 251: 0, 1,    3, 4, 5, 6, 7,  */  {  1, 13 },
295 /* 252:       2, 3, 4, 5, 6, 7,  */  {  2, 23 },
296 /* 253: 0,    2, 3, 4, 5, 6, 7,  */  {  1, 14 },
297 /* 254:    1, 2, 3, 4, 5, 6, 7,  */  {  1, 15 },
298 /* 255: 0, 1, 2, 3, 4, 5, 6, 7,  */  {  0, -1 }
299 };
300 //_____________________________________________________________________________
301 
302 
303 //_____________________________________________________________________________
304 // For each of the case above, the specific triangulation of the edge
305 // intersection pointsis given.
306 // When a case is ambiguous, the table contain first the face number to test
307 // and then the specific triangulations depending on the results
308 // A minus sign means to invert the result of the test.
309 //-----------------------------------------------------------------------------
310 static const char tiling1[16][3] = {
311 /*   1: 0,                       */  {  0,  8,  3 },
312 /*   2:    1,                    */  {  0,  1,  9 },
313 /*   4:       2,                 */  {  1,  2, 10 },
314 /*   8:          3,              */  {  3, 11,  2 },
315 /*  16:             4,           */  {  4,  7,  8 },
316 /*  32:                5,        */  {  9,  5,  4 },
317 /*  64:                   6,     */  { 10,  6,  5 },
318 /* 128:                      7,  */  {  7,  6, 11 },
319 /* 127: 0, 1, 2, 3, 4, 5, 6,     */  {  7, 11,  6 },
320 /* 191: 0, 1, 2, 3, 4, 5,    7,  */  { 10,  5,  6 },
321 /* 223: 0, 1, 2, 3, 4,    6, 7,  */  {  9,  4,  5 },
322 /* 239: 0, 1, 2, 3,    5, 6, 7,  */  {  4,  8,  7 },
323 /* 247: 0, 1, 2,    4, 5, 6, 7,  */  {  3,  2, 11 },
324 /* 251: 0, 1,    3, 4, 5, 6, 7,  */  {  1, 10,  2 },
325 /* 253: 0,    2, 3, 4, 5, 6, 7,  */  {  0,  9,  1 },
326 /* 254:    1, 2, 3, 4, 5, 6, 7,  */  {  0,  3,  8 }
327 };
328 //_____________________________________________________________________________
329 
330 static const char tiling2[24][6] = {
331 /*   3: 0, 1,                    */  {  1,  8,  3,  9,  8,  1 },
332 /*   9: 0,       3,              */  {  0, 11,  2,  8, 11,  0 },
333 /*  17: 0,          4,           */  {  4,  3,  0,  7,  3,  4 },
334 /*   6:    1, 2,                 */  {  9,  2, 10,  0,  2,  9 },
335 /*  34:    1,          5,        */  {  0,  5,  4,  1,  5,  0 },
336 /*  12:       2, 3,              */  {  3, 10,  1, 11, 10,  3 },
337 /*  68:       2,          6,     */  {  1,  6,  5,  2,  6,  1 },
338 /* 136:          3,          7,  */  {  7,  2,  3,  6,  2,  7 },
339 /*  48:             4, 5,        */  {  9,  7,  8,  5,  7,  9 },
340 /* 144:             4,       7,  */  {  6,  8,  4, 11,  8,  6 },
341 /*  96:                5, 6,     */  { 10,  4,  9,  6,  4, 10 },
342 /* 192:                   6, 7,  */  { 11,  5, 10,  7,  5, 11 },
343 /*  63: 0, 1, 2, 3, 4, 5,        */  { 11, 10,  5,  7, 11,  5 },
344 /* 159: 0, 1, 2, 3, 4,       7,  */  { 10,  9,  4,  6, 10,  4 },
345 /* 111: 0, 1, 2, 3,    5, 6,     */  {  6,  4,  8, 11,  6,  8 },
346 /* 207: 0, 1, 2, 3,       6, 7,  */  {  9,  8,  7,  5,  9,  7 },
347 /* 119: 0, 1, 2,    4, 5, 6,     */  {  7,  3,  2,  6,  7,  2 },
348 /* 187: 0, 1,    3, 4, 5,    7,  */  {  1,  5,  6,  2,  1,  6 },
349 /* 243: 0, 1,       4, 5, 6, 7,  */  {  3,  1, 10, 11,  3, 10 },
350 /* 221: 0,    2, 3, 4,    6, 7,  */  {  0,  4,  5,  1,  0,  5 },
351 /* 249: 0,       3, 4, 5, 6, 7,  */  {  9, 10,  2,  0,  9,  2 },
352 /* 238:    1, 2, 3,    5, 6, 7,  */  {  4,  0,  3,  7,  4,  3 },
353 /* 246:    1, 2,    4, 5, 6, 7,  */  {  0,  2, 11,  8,  0, 11 },
354 /* 252:       2, 3, 4, 5, 6, 7,  */  {  1,  3,  8,  9,  1,  8 }
355 };
356 //_____________________________________________________________________________
357 
358 // One face to test
359 // When the test on the specified face is positive : 4 first triangles
360 // When the test on the specified face is negative : 2 last triangles
361 static const char test3[24] = {
362 /*   5: 0,    2,                 */    5,
363 /*  33: 0,             5,        */    1,
364 /* 129: 0,                   7,  */    4,
365 /*  10:    1,    3,              */    5,
366 /*  18:    1,       4,           */    1,
367 /*  66:    1,             6,     */    2,
368 /*  36:       2,       5,        */    2,
369 /* 132:       2,             7,  */    3,
370 /*  24:          3, 4,           */    4,
371 /*  72:          3,       6,     */    3,
372 /*  80:             4,    6,     */    6,
373 /* 160:                5,    7,  */    6,
374 /*  95: 0, 1, 2, 3, 4,    6,     */   -6,
375 /* 175: 0, 1, 2, 3,    5,    7,  */   -6,
376 /* 183: 0, 1, 2,    4, 5,    7,  */   -3,
377 /* 231: 0, 1, 2,       5, 6, 7,  */   -4,
378 /* 123: 0, 1,    3, 4, 5, 6,     */   -3,
379 /* 219: 0, 1,    3, 4,    6, 7,  */   -2,
380 /* 189: 0,    2, 3, 4, 5,    7,  */   -2,
381 /* 237: 0,    2, 3,    5, 6, 7,  */   -1,
382 /* 245: 0,    2,    4, 5, 6, 7,  */   -5,
383 /* 126:    1, 2, 3, 4, 5, 6,     */   -4,
384 /* 222:    1, 2, 3, 4,    6, 7,  */   -1,
385 /* 250:    1,    3, 4, 5, 6, 7,  */   -5
386 };
387 
388 static const char tiling3[24][18] = {
389 /*   5: 0,    2,                 */  {  2,  3, 10,  3,  8, 10,  0,  1, 10,  0, 10,  8,    0,  8,  3,  1,  2, 10 },
390 /*  33: 0,             5,        */  {  8,  4,  3,  4,  5,  3,  9,  0,  3,  9,  3,  5,    9,  5,  4,  0,  8,  3 },
391 /* 129: 0,                   7,  */  {  7,  8,  6,  8,  0,  6,  3, 11,  6,  3,  6,  0,    3,  0,  8, 11,  7,  6 },
392 /*  10:    1,    3,              */  {  3,  0, 11,  0,  9, 11,  1,  2, 11,  1, 11,  9,    1,  9,  0,  2,  3, 11 },
393 /*  18:    1,       4,           */  {  4,  9,  7,  9,  1,  7,  0,  8,  7,  0,  7,  1,    0,  1,  9,  8,  4,  7 },
394 /*  66:    1,             6,     */  { 10,  1,  6,  1,  0,  6,  9,  0,  6,  9,  6,  5,    9,  0,  1,  5, 10,  6 },
395 /*  36:       2,       5,        */  {  5, 10,  4, 10,  2,  4,  1,  9,  4,  1,  4,  2,    1,  2, 10,  9,  5,  4 },
396 /* 132:       2,             7,  */  { 11,  2,  7,  2,  1,  7, 10,  6,  7, 10,  7,  1,   10,  1,  2,  6, 11,  7 },
397 /*  24:          3, 4,           */  { 11,  7,  2,  7,  4,  2,  8,  3,  2,  8,  2,  4,    8,  4,  7,  3, 11,  2 },
398 /*  72:          3,       6,     */  {  6, 11,  5, 11,  3,  5,  2, 10,  5,  2,  5,  3,    2,  3, 11, 10,  6,  5 },
399 /*  80:             4,    6,     */  {  7,  6,  8,  6, 10,  8,  5,  4,  8,  5,  8, 10,    5, 10,  6,  4,  7,  8 },
400 /* 160:                5,    7,  */  {  6,  5, 11,  5,  9, 11,  4,  7, 11,  4, 11,  9,    4,  9,  5,  7,  6, 11 },
401 /*  95: 0, 1, 2, 3, 4,    6,     */  {  6,  5, 11,  5,  9, 11,  4,  7, 11,  4, 11,  9,    4,  9,  5,  7,  6, 11 },
402 /* 175: 0, 1, 2, 3,    5,    7,  */  {  7,  6,  8,  6, 10,  8,  5,  4,  8,  5,  8, 10,    5, 10,  6,  4,  7,  8 },
403 /* 183: 0, 1, 2,    4, 5,    7,  */  {  6, 11,  5, 11,  3,  5,  2, 10,  5,  2,  5,  3,    2,  3, 11, 10,  6,  5 },
404 /* 231: 0, 1, 2,       5, 6, 7,  */  { 11,  7,  2,  7,  4,  2,  8,  3,  2,  8,  2,  4,    8,  4,  7,  3, 11,  2 },
405 /* 123: 0, 1,    3, 4, 5, 6,     */  { 11,  2,  7,  2,  1,  7, 10,  6,  7, 10,  7,  1,   10,  1,  2,  6, 11,  7 },
406 /* 219: 0, 1,    3, 4,    6, 7,  */  {  5, 10,  4, 10,  2,  4,  1,  9,  4,  1,  4,  2,    1,  2, 10,  9,  5,  4 },
407 /* 189: 0,    2, 3, 4, 5,    7,  */  { 10,  1,  6,  1,  0,  6,  9,  0,  6,  9,  6,  5,    9,  0,  1,  5, 10,  6 },
408 /* 237: 0,    2, 3,    5, 6, 7,  */  {  4,  9,  7,  9,  1,  7,  0,  8,  7,  0,  7,  1,    0,  1,  9,  8,  4,  7 },
409 /* 245: 0,    2,    4, 5, 6, 7,  */  {  3,  0, 11,  0,  9, 11,  1,  2, 11,  1, 11,  9,    1,  9,  0,  2,  3, 11 },
410 /* 126:    1, 2, 3, 4, 5, 6,     */  {  7,  8,  6,  8,  0,  6,  3, 11,  6,  3,  6,  0,    3,  0,  8, 11,  7,  6 },
411 /* 222:    1, 2, 3, 4,    6, 7,  */  {  8,  4,  3,  4,  5,  3,  9,  0,  3,  9,  3,  5,    9,  5,  4,  0,  8,  3 },
412 /* 250:    1,    3, 4, 5, 6, 7,  */  {  2,  3, 10,  3,  8, 10,  0,  1, 10,  0, 10,  8,    0,  8,  3,  1,  2, 10 }
413 };
414 //_____________________________________________________________________________
415 
416 // Interior to test
417 // When the test on the interior is negative : 2 first triangles
418 // When the test on the interior is positive : 6 last triangles
419 static const char test4[8] = {
420 /*  65: 0,                6,     */   7,
421 /* 130:    1,                7,  */   7,
422 /*  20:       2,    4,           */   7,
423 /*  40:          3,    5,        */   7,
424 /* 215: 0, 1, 2,    4,    6, 7,  */  -7,
425 /* 235: 0, 1,    3,    5, 6, 7,  */  -7,
426 /* 125: 0,    2, 3, 4, 5, 6,     */  -7,
427 /* 190:    1, 2, 3, 4, 5,    7,  */  -7
428 };
429 
430 static const char tiling4[8][24] = {
431 /*  65: 0,                6,     */  { 0,  8,  3,  5, 10,  6,    0,  5,  8,  5,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  5 },
432 /* 130:    1,                7,  */  { 0,  1,  9, 11,  7,  6,    1,  6,  9,  6,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1,  6 },
433 /*  20:       2,    4,           */  { 1,  2, 10,  8,  4,  7,    2,  7, 10,  7, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2,  7 },
434 /*  40:          3,    5,        */  { 9,  5,  4,  2,  3, 11,    3,  4, 11,  4, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  4 },
435 /* 215: 0, 1, 2,    4,    6, 7,  */  { 9,  5,  4,  2,  3, 11,    3,  4, 11,  4, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  4 },
436 /* 235: 0, 1,    3,    5, 6, 7,  */  { 1,  2, 10,  8,  4,  7,    2,  7, 10,  7, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2,  7 },
437 /* 125: 0,    2, 3, 4, 5, 6,     */  { 0,  1,  9, 11,  7,  6,    1,  6,  9,  6,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1,  6 },
438 /* 190:    1, 2, 3, 4, 5,    7,  */  { 0,  8,  3,  5, 10,  6,    0,  5,  8,  5,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  5 }
439 };
440 //_____________________________________________________________________________
441 
442 static const char tiling5[48][9] = {
443 /*   7: 0, 1, 2,                 */  {  2,  8,  3,  2, 10,  8, 10,  9,  8 },
444 /*  11: 0, 1,    3,              */  {  1, 11,  2,  1,  9, 11,  9,  8, 11 },
445 /*  19: 0, 1,       4,           */  {  4,  1,  9,  4,  7,  1,  7,  3,  1 },
446 /*  35: 0, 1,          5,        */  {  8,  5,  4,  8,  3,  5,  3,  1,  5 },
447 /*  13: 0,    2, 3,              */  {  0, 10,  1,  0,  8, 10,  8, 11, 10 },
448 /*  25: 0,       3, 4,           */  { 11,  4,  7, 11,  2,  4,  2,  0,  4 },
449 /* 137: 0,       3,          7,  */  {  7,  0,  8,  7,  6,  0,  6,  2,  0 },
450 /*  49: 0,          4, 5,        */  {  9,  3,  0,  9,  5,  3,  5,  7,  3 },
451 /* 145: 0,          4,       7,  */  {  3,  6, 11,  3,  0,  6,  0,  4,  6 },
452 /*  14:    1, 2, 3,              */  {  3,  9,  0,  3, 11,  9, 11, 10,  9 },
453 /*  38:    1, 2,       5,        */  {  5,  2, 10,  5,  4,  2,  4,  0,  2 },
454 /*  70:    1, 2,          6,     */  {  9,  6,  5,  9,  0,  6,  0,  2,  6 },
455 /*  50:    1,       4, 5,        */  {  0,  7,  8,  0,  1,  7,  1,  5,  7 },
456 /*  98:    1,          5, 6,     */  { 10,  0,  1, 10,  6,  0,  6,  4,  0 },
457 /*  76:       2, 3,       6,     */  {  6,  3, 11,  6,  5,  3,  5,  1,  3 },
458 /* 140:       2, 3,          7,  */  { 10,  7,  6, 10,  1,  7,  1,  3,  7 },
459 /* 100:       2,       5, 6,     */  {  1,  4,  9,  1,  2,  4,  2,  6,  4 },
460 /* 196:       2,          6, 7,  */  { 11,  1,  2, 11,  7,  1,  7,  5,  1 },
461 /* 152:          3, 4,       7,  */  {  8,  2,  3,  8,  4,  2,  4,  6,  2 },
462 /* 200:          3,       6, 7,  */  {  2,  5, 10,  2,  3,  5,  3,  7,  5 },
463 /* 112:             4, 5, 6,     */  {  7, 10,  6,  7,  8, 10,  8,  9, 10 },
464 /* 176:             4, 5,    7,  */  {  6,  9,  5,  6, 11,  9, 11,  8,  9 },
465 /* 208:             4,    6, 7,  */  {  5,  8,  4,  5, 10,  8, 10, 11,  8 },
466 /* 224:                5, 6, 7,  */  {  4, 11,  7,  4,  9, 11,  9, 10, 11 },
467 /*  31: 0, 1, 2, 3, 4,           */  {  4,  7, 11,  4, 11,  9,  9, 11, 10 },
468 /*  47: 0, 1, 2, 3,    5,        */  {  5,  4,  8,  5,  8, 10, 10,  8, 11 },
469 /*  79: 0, 1, 2, 3,       6,     */  {  6,  5,  9,  6,  9, 11, 11,  9,  8 },
470 /* 143: 0, 1, 2, 3,          7,  */  {  7,  6, 10,  7, 10,  8,  8, 10,  9 },
471 /*  55: 0, 1, 2,    4, 5,        */  {  2, 10,  5,  2,  5,  3,  3,  5,  7 },
472 /* 103: 0, 1, 2,       5, 6,     */  {  8,  3,  2,  8,  2,  4,  4,  2,  6 },
473 /*  59: 0, 1,    3, 4, 5,        */  { 11,  2,  1, 11,  1,  7,  7,  1,  5 },
474 /* 155: 0, 1,    3, 4,       7,  */  {  1,  9,  4,  1,  4,  2,  2,  4,  6 },
475 /* 115: 0, 1,       4, 5, 6,     */  { 10,  6,  7, 10,  7,  1,  1,  7,  3 },
476 /* 179: 0, 1,       4, 5,    7,  */  {  6, 11,  3,  6,  3,  5,  5,  3,  1 },
477 /* 157: 0,    2, 3, 4,       7,  */  { 10,  1,  0, 10,  0,  6,  6,  0,  4 },
478 /* 205: 0,    2, 3,       6, 7,  */  {  0,  8,  7,  0,  7,  1,  1,  7,  5 },
479 /* 185: 0,       3, 4, 5,    7,  */  {  9,  5,  6,  9,  6,  0,  0,  6,  2 },
480 /* 217: 0,       3, 4,    6, 7,  */  {  5, 10,  2,  5,  2,  4,  4,  2,  0 },
481 /* 241: 0,          4, 5, 6, 7,  */  {  3,  0,  9,  3,  9, 11, 11,  9, 10 },
482 /* 110:    1, 2, 3,    5, 6,     */  {  3, 11,  6,  3,  6,  0,  0,  6,  4 },
483 /* 206:    1, 2, 3,       6, 7,  */  {  9,  0,  3,  9,  3,  5,  5,  3,  7 },
484 /* 118:    1, 2,    4, 5, 6,     */  {  7,  8,  0,  7,  0,  6,  6,  0,  2 },
485 /* 230:    1, 2,       5, 6, 7,  */  { 11,  7,  4, 11,  4,  2,  2,  4,  0 },
486 /* 242:    1,       4, 5, 6, 7,  */  {  0,  1, 10,  0, 10,  8,  8, 10, 11 },
487 /* 220:       2, 3, 4,    6, 7,  */  {  8,  4,  5,  8,  5,  3,  3,  5,  1 },
488 /* 236:       2, 3,    5, 6, 7,  */  {  4,  9,  1,  4,  1,  7,  7,  1,  3 },
489 /* 244:       2,    4, 5, 6, 7,  */  {  1,  2, 11,  1, 11,  9,  9, 11,  8 },
490 /* 248:          3, 4, 5, 6, 7,  */  {  2,  3,  8,  2,  8, 10, 10,  8,  9 }
491 };
492 //_____________________________________________________________________________
493 
494 // 1 face to test + eventually the interior
495 // When the test on the specified face is positive : 5 first triangles
496 // When the test on the specified face is negative :
497 // - if the test on the interior is negative : 3 middle triangles
498 // - if the test on the interior is positive : 8 last triangles
499 
500 static const char test6[48][2] = {
501 /*  67: 0, 1,             6,     */  {  2,  7 },
502 /* 131: 0, 1,                7,  */  {  4,  7 },
503 /*  21: 0,    2,    4,           */  {  5,  7 },
504 /*  69: 0,    2,          6,     */  {  5,  7 },
505 /*  41: 0,       3,    5,        */  {  1,  7 },
506 /*  73: 0,       3,       6,     */  {  3,  7 },
507 /*  81: 0,          4,    6,     */  {  6,  7 },
508 /*  97: 0,             5, 6,     */  {  1,  7 },
509 /* 193: 0,                6, 7,  */  {  4,  7 },
510 /*  22:    1, 2,    4,           */  {  1,  7 },
511 /* 134:    1, 2,             7,  */  {  3,  7 },
512 /*  42:    1,    3,    5,        */  {  5,  7 },
513 /* 138:    1,    3,          7,  */  {  5,  7 },
514 /* 146:    1,       4,       7,  */  {  1,  7 },
515 /* 162:    1,          5,    7,  */  {  6,  7 },
516 /* 194:    1,             6, 7,  */  {  2,  7 },
517 /*  28:       2, 3, 4,           */  {  4,  7 },
518 /*  44:       2, 3,    5,        */  {  2,  7 },
519 /*  52:       2,    4, 5,        */  {  2,  7 },
520 /*  84:       2,    4,    6,     */  {  6,  7 },
521 /* 148:       2,    4,       7,  */  {  3,  7 },
522 /*  56:          3, 4, 5,        */  {  4,  7 },
523 /* 104:          3,    5, 6,     */  {  3,  7 },
524 /* 168:          3,    5,    7,  */  {  6,  7 },
525 /*  87: 0, 1, 2,    4,    6,     */  { -6, -7 },
526 /* 151: 0, 1, 2,    4,       7,  */  { -3, -7 },
527 /* 199: 0, 1, 2,          6, 7,  */  { -4, -7 },
528 /* 107: 0, 1,    3,    5, 6,     */  { -3, -7 },
529 /* 171: 0, 1,    3,    5,    7,  */  { -6, -7 },
530 /* 203: 0, 1,    3,       6, 7,  */  { -2, -7 },
531 /* 211: 0, 1,       4,    6, 7,  */  { -2, -7 },
532 /* 227: 0, 1,          5, 6, 7,  */  { -4, -7 },
533 /*  61: 0,    2, 3, 4, 5,        */  { -2, -7 },
534 /*  93: 0,    2, 3, 4,    6,     */  { -6, -7 },
535 /* 109: 0,    2, 3,    5, 6,     */  { -1, -7 },
536 /* 117: 0,    2,    4, 5, 6,     */  { -5, -7 },
537 /* 213: 0,    2,    4,    6, 7,  */  { -5, -7 },
538 /* 121: 0,       3, 4, 5, 6,     */  { -3, -7 },
539 /* 233: 0,       3,    5, 6, 7,  */  { -1, -7 },
540 /*  62:    1, 2, 3, 4, 5,        */  { -4, -7 },
541 /* 158:    1, 2, 3, 4,       7,  */  { -1, -7 },
542 /* 174:    1, 2, 3,    5,    7,  */  { -6, -7 },
543 /* 182:    1, 2,    4, 5,    7,  */  { -3, -7 },
544 /* 214:    1, 2,    4,    6, 7,  */  { -1, -7 },
545 /* 186:    1,    3, 4, 5,    7,  */  { -5, -7 },
546 /* 234:    1,    3,    5, 6, 7,  */  { -5, -7 },
547 /* 124:       2, 3, 4, 5, 6,     */  { -4, -7 },
548 /* 188:       2, 3, 4, 5,    7,  */  { -2, -7 }
549 };
550 
551 static const char tiling6[48][45] = {
552 /*  67: 0, 1,             6,     */  {  1, 10,  3, 10,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  9,   10,  5,  6,  3,  1,  8,  1,  8,  9,     1, 10,  3, 10,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  9,  5,  9,  1,  5,  1, 10 },
553 /* 131: 0, 1,                7,  */  {  3, 11,  1, 11,  1,  6,  1,  6,  9,  6,  9,  7,  9,  7,  8,   11,  7,  6,  1,  3,  9,  3,  9,  8,     3, 11,  1, 11,  1,  6,  1,  6,  9,  6,  9,  7,  9,  7,  8,  7,  8,  3,  7,  3, 11 },
554 /*  21: 0,    2,    4,           */  {  0,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7,  2,  7,  2,  3,    1,  2, 10,  4,  0,  7,  0,  7,  3,     0,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7,  2,  7,  2,  3,  2,  3,  0,  2,  0,  1 },
555 /*  69: 0,    2,          6,     */  {  2,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  0,  5,  0,  1,    3,  0,  8,  6,  2,  5,  2,  5,  1,     2,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  0,  5,  0,  1,  0,  1,  2,  0,  2,  3 },
556 /*  41: 0,       3,    5,        */  {  0,  9,  2,  9,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  8,    9,  4,  5,  2,  0, 11,  0, 11,  8,     0,  9,  2,  9,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  8,  4,  8,  0,  4,  0,  9 },
557 /*  73: 0,       3,       6,     */  {  2, 10,  0, 10,  0,  5,  0,  5,  8,  5,  8,  6,  8,  6, 11,   10,  6,  5,  0,  2,  8,  2,  8, 11,     2, 10,  0, 10,  0,  5,  0,  5,  8,  5,  8,  6,  8,  6, 11,  6, 11,  2,  6,  2, 10 },
558 /*  81: 0,          4,    6,     */  {  4,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3,  6,  3,  6,  7,    5,  6, 10,  0,  4,  3,  4,  3,  7,     4,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3,  6,  3,  6,  7,  6,  7,  4,  6,  4,  5 },
559 /*  97: 0,             5, 6,     */  {  4,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  9,    8,  0,  3,  6,  4, 10,  4, 10,  9,     4,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  9,  0,  9,  4,  0,  4,  8 },
560 /* 193: 0,                6, 7,  */  {  7,  8,  5,  8,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3, 11,    8,  3,  0,  5,  7, 10,  7, 10, 11,     7,  8,  5,  8,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3, 11,  3, 11,  7,  3,  7,  8 },
561 /*  22:    1, 2,    4,           */  {  0,  8,  2,  8,  2,  7,  2,  7, 10,  7, 10,  4, 10,  4,  9,    8,  4,  7,  2,  0, 10,  0, 10,  9,     0,  8,  2,  8,  2,  7,  2,  7, 10,  7, 10,  4, 10,  4,  9,  4,  9,  0,  4,  0,  8 },
562 /* 134:    1, 2,             7,  */  {  2, 11,  0, 11,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6, 10,   11,  6,  7,  0,  2,  9,  2,  9, 10,     2, 11,  0, 11,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6, 10,  6, 10,  2,  6,  2, 11 },
563 /*  42:    1,    3,    5,        */  {  1,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  3,  4,  3,  0,    2,  3, 11,  5,  1,  4,  1,  4,  0,     1,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  3,  4,  3,  0,  3,  0,  1,  3,  1,  2 },
564 /* 138:    1,    3,          7,  */  {  3,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6,  1,  6,  1,  2,    0,  1,  9,  7,  3,  6,  3,  6,  2,     3,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6,  1,  6,  1,  2,  1,  2,  3,  1,  3,  0 },
565 /* 146:    1,       4,       7,  */  {  4,  9,  6,  9,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  8,    9,  0,  1,  6,  4, 11,  4, 11,  8,     4,  9,  6,  9,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  8,  0,  8,  4,  0,  4,  9 },
566 /* 162:    1,          5,    7,  */  {  5,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  7,  0,  7,  4,    6,  7, 11,  1,  5,  0,  5,  0,  4,     5,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  7,  0,  7,  4,  7,  4,  5,  7,  5,  6 },
567 /* 194:    1,             6, 7,  */  {  5,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1, 10,    9,  1,  0,  7,  5, 11,  5, 11, 10,     5,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1, 10,  1, 10,  5,  1,  5,  9 },
568 /*  28:       2, 3, 4,           */  {  3,  8,  1,  8,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7, 11,    8,  7,  4,  1,  3, 10,  3, 10, 11,     3,  8,  1,  8,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7, 11,  7, 11,  3,  7,  3,  8 },
569 /*  44:       2, 3,    5,        */  {  1,  9,  3,  9,  3,  4,  3,  4, 11,  4, 11,  5, 11,  5, 10,    9,  5,  4,  3,  1, 11,  1, 11, 10,     1,  9,  3,  9,  3,  4,  3,  4, 11,  4, 11,  5, 11,  5, 10,  5, 10,  1,  5,  1,  9 },
570 /*  52:       2,    4, 5,        */  {  5, 10,  7, 10,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  9,   10,  1,  2,  7,  5,  8,  5,  8,  9,     5, 10,  7, 10,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  9,  1,  9,  5,  1,  5, 10 },
571 /*  84:       2,    4,    6,     */  {  6,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  4,  1,  4,  5,    7,  4,  8,  2,  6,  1,  6,  1,  5,     6,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  4,  1,  4,  5,  4,  5,  6,  4,  6,  7 },
572 /* 148:       2,    4,       7,  */  {  6, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2, 11,   10,  2,  1,  4,  6,  8,  6,  8, 11,     6, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2, 11,  2, 11,  6,  2,  6, 10 },
573 /*  56:          3, 4, 5,        */  {  7, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  8,   11,  3,  2,  5,  7,  9,  7,  9,  8,     7, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  8,  3,  8,  7,  3,  7, 11 },
574 /* 104:          3,    5, 6,     */  {  6, 11,  4, 11,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2, 10,   11,  2,  3,  4,  6,  9,  6,  9, 10,     6, 11,  4, 11,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2, 10,  2, 10,  6,  2,  6, 11 },
575 /* 168:          3,    5,    7,  */  {  7,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2,  5,  2,  5,  6,    4,  5,  9,  3,  7,  2,  7,  2,  6,     7,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2,  5,  2,  5,  6,  5,  6,  7,  5,  7,  4 },
576 /*  87: 0, 1, 2,    4,    6,     */  {  7,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2,  5,  2,  5,  6,    4,  5,  9,  3,  7,  2,  7,  2,  6,     7,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2,  5,  2,  5,  6,  5,  6,  7,  5,  7,  4 },
577 /* 151: 0, 1, 2,    4,       7,  */  {  6, 11,  4, 11,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2, 10,   11,  2,  3,  4,  6,  9,  6,  9, 10,     6, 11,  4, 11,  4,  3,  4,  3,  9,  3,  9,  2,  9,  2, 10,  2, 10,  6,  2,  6, 11 },
578 /* 199: 0, 1, 2,          6, 7,  */  {  7, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  8,   11,  3,  2,  5,  7,  9,  7,  9,  8,     7, 11,  5, 11,  5,  2,  5,  2,  9,  2,  9,  3,  9,  3,  8,  3,  8,  7,  3,  7, 11 },
579 /* 107: 0, 1,    3,    5, 6,     */  {  6, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2, 11,   10,  2,  1,  4,  6,  8,  6,  8, 11,     6, 10,  4, 10,  4,  1,  4,  1,  8,  1,  8,  2,  8,  2, 11,  2, 11,  6,  2,  6, 10 },
580 /* 171: 0, 1,    3,    5,    7,  */  {  6,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  4,  1,  4,  5,    7,  4,  8,  2,  6,  1,  6,  1,  5,     6,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  4,  1,  4,  5,  4,  5,  6,  4,  6,  7 },
581 /* 203: 0, 1,    3,       6, 7,  */  {  5, 10,  7, 10,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  9,   10,  1,  2,  7,  5,  8,  5,  8,  9,     5, 10,  7, 10,  7,  2,  7,  2,  8,  2,  8,  1,  8,  1,  9,  1,  9,  5,  1,  5, 10 },
582 /* 211: 0, 1,       4,    6, 7,  */  {  1,  9,  3,  9,  3,  4,  3,  4, 11,  4, 11,  5, 11,  5, 10,    9,  5,  4,  3,  1, 11,  1, 11, 10,     1,  9,  3,  9,  3,  4,  3,  4, 11,  4, 11,  5, 11,  5, 10,  5, 10,  1,  5,  1,  9 },
583 /* 227: 0, 1,          5, 6, 7,  */  {  3,  8,  1,  8,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7, 11,    8,  7,  4,  1,  3, 10,  3, 10, 11,     3,  8,  1,  8,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7, 11,  7, 11,  3,  7,  3,  8 },
584 /*  61: 0,    2, 3, 4, 5,        */  {  5,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1, 10,    9,  1,  0,  7,  5, 11,  5, 11, 10,     5,  9,  7,  9,  7,  0,  7,  0, 11,  0, 11,  1, 11,  1, 10,  1, 10,  5,  1,  5,  9 },
585 /*  93: 0,    2, 3, 4,    6,     */  {  5,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  7,  0,  7,  4,    6,  7, 11,  1,  5,  0,  5,  0,  4,     5,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  7,  0,  7,  4,  7,  4,  5,  7,  5,  6 },
586 /* 109: 0,    2, 3,    5, 6,     */  {  4,  9,  6,  9,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  8,    9,  0,  1,  6,  4, 11,  4, 11,  8,     4,  9,  6,  9,  6,  1,  6,  1, 11,  1, 11,  0, 11,  0,  8,  0,  8,  4,  0,  4,  9 },
587 /* 117: 0,    2,    4, 5, 6,     */  {  3,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6,  1,  6,  1,  2,    0,  1,  9,  7,  3,  6,  3,  6,  2,     3,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6,  1,  6,  1,  2,  1,  2,  3,  1,  3,  0 },
588 /* 213: 0,    2,    4,    6, 7,  */  {  1,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  3,  4,  3,  0,    2,  3, 11,  5,  1,  4,  1,  4,  0,     1,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  3,  4,  3,  0,  3,  0,  1,  3,  1,  2 },
589 /* 121: 0,       3, 4, 5, 6,     */  {  2, 11,  0, 11,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6, 10,   11,  6,  7,  0,  2,  9,  2,  9, 10,     2, 11,  0, 11,  0,  7,  0,  7,  9,  7,  9,  6,  9,  6, 10,  6, 10,  2,  6,  2, 11 },
590 /* 233: 0,       3,    5, 6, 7,  */  {  0,  8,  2,  8,  2,  7,  2,  7, 10,  7, 10,  4, 10,  4,  9,    8,  4,  7,  2,  0, 10,  0, 10,  9,     0,  8,  2,  8,  2,  7,  2,  7, 10,  7, 10,  4, 10,  4,  9,  4,  9,  0,  4,  0,  8 },
591 /*  62:    1, 2, 3, 4, 5,        */  {  7,  8,  5,  8,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3, 11,    8,  3,  0,  5,  7, 10,  7, 10, 11,     7,  8,  5,  8,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3, 11,  3, 11,  7,  3,  7,  8 },
592 /* 158:    1, 2, 3, 4,       7,  */  {  4,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  9,    8,  0,  3,  6,  4, 10,  4, 10,  9,     4,  8,  6,  8,  6,  3,  6,  3, 10,  3, 10,  0, 10,  0,  9,  0,  9,  4,  0,  4,  8 },
593 /* 174:    1, 2, 3,    5,    7,  */  {  4,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3,  6,  3,  6,  7,    5,  6, 10,  0,  4,  3,  4,  3,  7,     4,  5,  0,  5,  0, 10,  0, 10,  3, 10,  3,  6,  3,  6,  7,  6,  7,  4,  6,  4,  5 },
594 /* 182:    1, 2,    4, 5,    7,  */  {  2, 10,  0, 10,  0,  5,  0,  5,  8,  5,  8,  6,  8,  6, 11,   10,  6,  5,  0,  2,  8,  2,  8, 11,     2, 10,  0, 10,  0,  5,  0,  5,  8,  5,  8,  6,  8,  6, 11,  6, 11,  2,  6,  2, 10 },
595 /* 214:    1, 2,    4,    6, 7,  */  {  0,  9,  2,  9,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  8,    9,  4,  5,  2,  0, 11,  0, 11,  8,     0,  9,  2,  9,  2,  5,  2,  5, 11,  5, 11,  4, 11,  4,  8,  4,  8,  0,  4,  0,  9 },
596 /* 186:    1,    3, 4, 5,    7,  */  {  2,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  0,  5,  0,  1,    3,  0,  8,  6,  2,  5,  2,  5,  1,     2,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  0,  5,  0,  1,  0,  1,  2,  0,  2,  3 },
597 /* 234:    1,    3,    5, 6, 7,  */  {  0,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7,  2,  7,  2,  3,    1,  2, 10,  4,  0,  7,  0,  7,  3,     0,  1,  4,  1,  4, 10,  4, 10,  7, 10,  7,  2,  7,  2,  3,  2,  3,  0,  2,  0,  1 },
598 /* 124:       2, 3, 4, 5, 6,     */  {  3, 11,  1, 11,  1,  6,  1,  6,  9,  6,  9,  7,  9,  7,  8,   11,  7,  6,  1,  3,  9,  3,  9,  8,     3, 11,  1, 11,  1,  6,  1,  6,  9,  6,  9,  7,  9,  7,  8,  7,  8,  3,  7,  3, 11 },
599 /* 188:       2, 3, 4, 5,    7,  */  {  1, 10,  3, 10,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  9,   10,  5,  6,  3,  1,  8,  1,  8,  9,     1, 10,  3, 10,  3,  6,  3,  6,  8,  6,  8,  5,  8,  5,  9,  5,  9,  1,  5,  1, 10 }
600 };
601 //_____________________________________________________________________________
602 
603 // 3 faces to test + eventually the interior
604 // When the tests on the 3 specified faces are positive :
605 // - if the test on the interior is positive : 5 first triangles
606 // - if the test on the interior is negative : 9 next triangles
607 // When the tests on the first  and the second specified faces are positive : 9 next triangles
608 // When the tests on the first  and the third  specified faces are positive : 9 next triangles
609 // When the tests on the second and the third  specified faces are positive : 9 next triangles
610 // When the test on the first  specified face is positive : 5 next triangles
611 // When the test on the second specified face is positive : 5 next triangles
612 // When the test on the third  specified face is positive : 5 next triangles
613 // When the tests on the 3 specified faces are negative : 3 last triangles
614 
615 static const char test7[16][4] = {
616 /*  37: 0,    2,       5,        */  {  1,  2,  5,  7 },
617 /* 133: 0,    2,             7,  */  {  3,  4,  5,  7 },
618 /* 161: 0,             5,    7,  */  {  4,  1,  6,  7 },
619 /*  26:    1,    3, 4,           */  {  4,  1,  5,  7 },
620 /*  74:    1,    3,       6,     */  {  2,  3,  5,  7 },
621 /*  82:    1,       4,    6,     */  {  1,  2,  6,  7 },
622 /* 164:       2,       5,    7,  */  {  2,  3,  6,  7 },
623 /*  88:          3, 4,    6,     */  {  3,  4,  6,  7 },
624 /* 167: 0, 1, 2,       5,    7,  */  { -3, -4, -6, -7 },
625 /*  91: 0, 1,    3, 4,    6,     */  { -2, -3, -6, -7 },
626 /* 173: 0,    2, 3,    5,    7,  */  { -1, -2, -6, -7 },
627 /* 181: 0,    2,    4, 5,    7,  */  { -2, -3, -5, -7 },
628 /* 229: 0,    2,       5, 6, 7,  */  { -4, -1, -5, -7 },
629 /*  94:    1, 2, 3, 4,    6,     */  { -4, -1, -6, -7 },
630 /* 122:    1,    3, 4, 5, 6,     */  { -3, -4, -5, -7 },
631 /* 218:    1,    3, 4,    6, 7,  */  { -1, -2, -5, -7 }
632 };
633 
634 /* 7: sub configs */
635 static const char subconfig7[8] = {
636 /*  0: 0,0,0 */ 7,
637 /*  1: 1,0,0 */ 6,
638 /*  2: 0,1,0 */ 5,
639 /*  3: 1,1,0 */ 3,
640 /*  4: 0,0,1 */ 4,
641 /*  5: 1,0,1 */ 2,
642 /*  6: 0,1,1 */ 1,
643 /*  7: 1,1,1 */ 0,
644 };
645 
646 
647 static const char tiling7[16][177] = {
648 /*  37: 0,    2,       5,        */  {  8,  4,  3,  4,  3, 10,  3, 10,  2,  4, 10,  5,  0,  1,  9,    8,  4,  9,  4,  9,  5,  9,  5, 10,  9, 10,  1, 10,  1,  2,  1,  2,  0,  2,  0,  3,  0,  3,  8,  0,  8,  9,    12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2,    12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5,    12,  4,  5, 12,  5, 10, 12, 10,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4,     1,  2, 10,  8,  4,  3,  4,  3,  5,  3,  5,  0,  5,  0,  9,     3,  0,  8,  9,  1,  4,  1,  4,  2,  4,  2,  5,  2,  5, 10,     4,  5,  9,  1, 10,  0, 10,  0,  8, 10,  8,  2,  8,  2,  3,     4,  5,  9, 10,  1,  2,  0,  3,  8 },
649 /* 133: 0,    2,             7,  */  { 10,  6,  1,  6,  1,  8,  1,  8,  0,  6,  8,  7,  2,  3, 11,   10,  6, 11,  6, 11,  7, 11,  7,  8, 11,  8,  3,  8,  3,  0,  3,  0,  2,  0,  2,  1,  2,  1, 10,  2, 10, 11,    12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0,    12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7,    12,  6,  7, 12,  7,  8, 12,  8,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6,     3,  0,  8, 10,  6,  1,  6,  1,  7,  1,  7,  2,  7,  2, 11,     1,  2, 10, 11,  3,  6,  3,  6,  0,  6,  0,  7,  0,  7,  8,     6,  7, 11,  3,  8,  2,  8,  2, 10,  8, 10,  0, 10,  0,  1,     6,  7, 11,  8,  3,  0,  2,  1, 10 },
650 /* 161: 0,             5,    7,  */  { 11,  3,  6,  3,  6,  9,  6,  9,  5,  3,  9,  0,  7,  4,  8,   11,  3,  8,  3,  8,  0,  8,  0,  9,  8,  9,  4,  9,  4,  5,  4,  5,  7,  5,  7,  6,  7,  6, 11,  7, 11,  8,    12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5,    12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  4, 12,  4,  7, 12,  7,  8, 12,  8,  0,    12,  3,  0, 12,  0,  9, 12,  9,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3,     4,  5,  9, 11,  3,  6,  3,  6,  0,  6,  0,  7,  0,  7,  8,     6,  7, 11,  8,  4,  3,  4,  3,  5,  3,  5,  0,  5,  0,  9,     3,  0,  8,  4,  9,  7,  9,  7, 11,  9, 11,  5, 11,  5,  6,     3,  0,  8,  9,  4,  5,  7,  6, 11 },
651 /*  26:    1,    3, 4,           */  { 11,  7,  2,  7,  2,  9,  2,  9,  1,  7,  9,  4,  3,  0,  8,   11,  7,  8,  7,  8,  4,  8,  4,  9,  8,  9,  0,  9,  0,  1,  0,  1,  3,  1,  3,  2,  3,  2, 11,  3, 11,  8,    12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1,    12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  8, 12,  8,  4,    12,  7,  4, 12,  4,  9, 12,  9,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  8, 12,  8,  7,     0,  1,  9, 11,  7,  2,  7,  2,  4,  2,  4,  3,  4,  3,  8,     2,  3, 11,  8,  0,  7,  0,  7,  1,  7,  1,  4,  1,  4,  9,     7,  4,  8,  0,  9,  3,  9,  3, 11,  9, 11,  1, 11,  1,  2,     7,  4,  8,  9,  0,  1,  3,  2, 11 },
652 /*  74:    1,    3,       6,     */  {  9,  5,  0,  5,  0, 11,  0, 11,  3,  5, 11,  6,  1,  2, 10,    9,  5, 10,  5, 10,  6, 10,  6, 11, 10, 11,  2, 11,  2,  3,  2,  3,  1,  3,  1,  0,  1,  0,  9,  1,  9, 10,    12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3,    12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1, 10, 12, 10,  6,    12,  5,  6, 12,  6, 11, 12, 11,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5,     2,  3, 11,  9,  5,  0,  5,  0,  6,  0,  6,  1,  6,  1, 10,     0,  1,  9, 10,  2,  5,  2,  5,  3,  5,  3,  6,  3,  6, 11,     5,  6, 10,  2, 11,  1, 11,  1,  9, 11,  9,  3,  9,  3,  0,     5,  6, 10, 11,  2,  3,  1,  0,  9 },
653 /*  82:    1,       4,    6,     */  {  8,  0,  7,  0,  7, 10,  7, 10,  6,  0, 10,  1,  4,  5,  9,    8,  0,  9,  0,  9,  1,  9,  1, 10,  9, 10,  5, 10,  5,  6,  5,  6,  4,  6,  4,  7,  4,  7,  8,  4,  8,  9,    12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6,    12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  5, 12,  5,  4, 12,  4,  9, 12,  9,  1,    12,  0,  1, 12,  1, 10, 12, 10,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0,     5,  6, 10,  8,  0,  7,  0,  7,  1,  7,  1,  4,  1,  4,  9,     7,  4,  8,  9,  5,  0,  5,  0,  6,  0,  6,  1,  6,  1, 10,     0,  1,  9,  5, 10,  4, 10,  4,  8, 10,  8,  6,  8,  6,  7,     0,  1,  9, 10,  5,  6,  4,  7,  8 },
654 /* 164:       2,       5,    7,  */  {  9,  1,  4,  1,  4, 11,  4, 11,  7,  1, 11,  2,  5,  6, 10,    9,  1, 10,  1, 10,  2, 10,  2, 11, 10, 11,  6, 11,  6,  7,  6,  7,  5,  7,  5,  4,  5,  4,  9,  5,  9, 10,    12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7,    12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  6, 12,  6,  5, 12,  5, 10, 12, 10,  2,    12,  1,  2, 12,  2, 11, 12, 11,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1,     6,  7, 11,  9,  1,  4,  1,  4,  2,  4,  2,  5,  2,  5, 10,     4,  5,  9, 10,  6,  1,  6,  1,  7,  1,  7,  2,  7,  2, 11,     1,  2, 10,  6, 11,  5, 11,  5,  9, 11,  9,  7,  9,  7,  4,     1,  2, 10, 11,  6,  7,  5,  4,  9 },
655 /*  88:          3, 4,    6,     */  { 10,  2,  5,  2,  5,  8,  5,  8,  4,  2,  8,  3,  6,  7, 11,   10,  2, 11,  2, 11,  3, 11,  3,  8, 11,  8,  7,  8,  7,  4,  7,  4,  6,  4,  6,  5,  6,  5, 10,  6, 10, 11,    12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4,    12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  7, 12,  7,  6, 12,  6, 11, 12, 11,  3,    12,  2,  3, 12,  3,  8, 12,  8,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2,     7,  4,  8, 10,  2,  5,  2,  5,  3,  5,  3,  6,  3,  6, 11,     5,  6, 10, 11,  7,  2,  7,  2,  4,  2,  4,  3,  4,  3,  8,     2,  3, 11,  7,  8,  6,  8,  6, 10,  8, 10,  4, 10,  4,  5,     2,  3, 11,  8,  7,  4,  6,  5, 10 },
656 /* 167: 0, 1, 2,       5,    7,  */  { 10,  2,  5,  2,  5,  8,  5,  8,  4,  2,  8,  3,  6,  7, 11,   10,  2, 11,  2, 11,  3, 11,  3,  8, 11,  8,  7,  8,  7,  4,  7,  4,  6,  4,  6,  5,  6,  5, 10,  6, 10, 11,    12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4,    12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  7, 12,  7,  6, 12,  6, 11, 12, 11,  3,    12,  2,  3, 12,  3,  8, 12,  8,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2,     7,  4,  8, 10,  2,  5,  2,  5,  3,  5,  3,  6,  3,  6, 11,     5,  6, 10, 11,  7,  2,  7,  2,  4,  2,  4,  3,  4,  3,  8,     2,  3, 11,  7,  8,  6,  8,  6, 10,  8, 10,  4, 10,  4,  5,     2,  3, 11,  8,  7,  4,  6,  5, 10 },
657 /*  91: 0, 1,    3, 4,    6,     */  {  9,  1,  4,  1,  4, 11,  4, 11,  7,  1, 11,  2,  5,  6, 10,    9,  1, 10,  1, 10,  2, 10,  2, 11, 10, 11,  6, 11,  6,  7,  6,  7,  5,  7,  5,  4,  5,  4,  9,  5,  9, 10,    12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7,    12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  6, 12,  6,  5, 12,  5, 10, 12, 10,  2,    12,  1,  2, 12,  2, 11, 12, 11,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1,     6,  7, 11,  9,  1,  4,  1,  4,  2,  4,  2,  5,  2,  5, 10,     4,  5,  9, 10,  6,  1,  6,  1,  7,  1,  7,  2,  7,  2, 11,     1,  2, 10,  6, 11,  5, 11,  5,  9, 11,  9,  7,  9,  7,  4,     1,  2, 10, 11,  6,  7,  5,  4,  9 },
658 /* 173: 0,    2, 3,    5,    7,  */  {  8,  0,  7,  0,  7, 10,  7, 10,  6,  0, 10,  1,  4,  5,  9,    8,  0,  9,  0,  9,  1,  9,  1, 10,  9, 10,  5, 10,  5,  6,  5,  6,  4,  6,  4,  7,  4,  7,  8,  4,  8,  9,    12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6,    12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  5, 12,  5,  4, 12,  4,  9, 12,  9,  1,    12,  0,  1, 12,  1, 10, 12, 10,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0,     5,  6, 10,  8,  0,  7,  0,  7,  1,  7,  1,  4,  1,  4,  9,     7,  4,  8,  9,  5,  0,  5,  0,  6,  0,  6,  1,  6,  1, 10,     0,  1,  9,  5, 10,  4, 10,  4,  8, 10,  8,  6,  8,  6,  7,     0,  1,  9, 10,  5,  6,  4,  7,  8 },
659 /* 181: 0,    2,    4, 5,    7,  */  {  9,  5,  0,  5,  0, 11,  0, 11,  3,  5, 11,  6,  1,  2, 10,    9,  5, 10,  5, 10,  6, 10,  6, 11, 10, 11,  2, 11,  2,  3,  2,  3,  1,  3,  1,  0,  1,  0,  9,  1,  9, 10,    12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3,    12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1, 10, 12, 10,  6,    12,  5,  6, 12,  6, 11, 12, 11,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5,     2,  3, 11,  9,  5,  0,  5,  0,  6,  0,  6,  1,  6,  1, 10,     0,  1,  9, 10,  2,  5,  2,  5,  3,  5,  3,  6,  3,  6, 11,     5,  6, 10,  2, 11,  1, 11,  1,  9, 11,  9,  3,  9,  3,  0,     5,  6, 10, 11,  2,  3,  1,  0,  9 },
660 /* 229: 0,    2,       5, 6, 7,  */  { 11,  7,  2,  7,  2,  9,  2,  9,  1,  7,  9,  4,  3,  0,  8,   11,  7,  8,  7,  8,  4,  8,  4,  9,  8,  9,  0,  9,  0,  1,  0,  1,  3,  1,  3,  2,  3,  2, 11,  3, 11,  8,    12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1,    12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  8, 12,  8,  4,    12,  7,  4, 12,  4,  9, 12,  9,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  8, 12,  8,  7,     0,  1,  9, 11,  7,  2,  7,  2,  4,  2,  4,  3,  4,  3,  8,     2,  3, 11,  8,  0,  7,  0,  7,  1,  7,  1,  4,  1,  4,  9,     7,  4,  8,  0,  9,  3,  9,  3, 11,  9, 11,  1, 11,  1,  2,     7,  4,  8,  9,  0,  1,  3,  2, 11 },
661 /*  94:    1, 2, 3, 4,    6,     */  { 11,  3,  6,  3,  6,  9,  6,  9,  5,  3,  9,  0,  7,  4,  8,   11,  3,  8,  3,  8,  0,  8,  0,  9,  8,  9,  4,  9,  4,  5,  4,  5,  7,  5,  7,  6,  7,  6, 11,  7, 11,  8,    12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5,    12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  4, 12,  4,  7, 12,  7,  8, 12,  8,  0,    12,  3,  0, 12,  0,  9, 12,  9,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3,     4,  5,  9, 11,  3,  6,  3,  6,  0,  6,  0,  7,  0,  7,  8,     6,  7, 11,  8,  4,  3,  4,  3,  5,  3,  5,  0,  5,  0,  9,     3,  0,  8,  4,  9,  7,  9,  7, 11,  9, 11,  5, 11,  5,  6,     3,  0,  8,  9,  4,  5,  7,  6, 11 },
662 /* 122:    1,    3, 4, 5, 6,     */  { 10,  6,  1,  6,  1,  8,  1,  8,  0,  6,  8,  7,  2,  3, 11,   10,  6, 11,  6, 11,  7, 11,  7,  8, 11,  8,  3,  8,  3,  0,  3,  0,  2,  0,  2,  1,  2,  1, 10,  2, 10, 11,    12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0,    12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7,    12,  6,  7, 12,  7,  8, 12,  8,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6,     3,  0,  8, 10,  6,  1,  6,  1,  7,  1,  7,  2,  7,  2, 11,     1,  2, 10, 11,  3,  6,  3,  6,  0,  6,  0,  7,  0,  7,  8,     6,  7, 11,  3,  8,  2,  8,  2, 10,  8, 10,  0, 10,  0,  1,     6,  7, 11,  8,  3,  0,  2,  1, 10 },
663 /* 218:    1,    3, 4,    6, 7,  */  {  8,  4,  3,  4,  3, 10,  3, 10,  2,  4, 10,  5,  0,  1,  9,    8,  4,  9,  4,  9,  5,  9,  5, 10,  9, 10,  1, 10,  1,  2,  1,  2,  0,  2,  0,  3,  0,  3,  8,  0,  8,  9,    12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2,    12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5,    12,  4,  5, 12,  5, 10, 12, 10,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4,     1,  2, 10,  8,  4,  3,  4,  3,  5,  3,  5,  0,  5,  0,  9,     3,  0,  8,  9,  1,  4,  1,  4,  2,  4,  2,  5,  2,  5, 10,     4,  5,  9,  1, 10,  0, 10,  0,  8, 10,  8,  2,  8,  2,  3,     4,  5,  9, 10,  1,  2,  0,  3,  8 }
664 };
665 //_____________________________________________________________________________
666 
667 static const char tiling8[6][6] = {
668 /*  15: 0, 1, 2, 3,              */  { 9,  8, 10, 10,  8, 11 },
669 /*  51: 0, 1,       4, 5,        */  { 1,  5,  3,  3,  5,  7 },
670 /* 153: 0,       3, 4,       7,  */  { 0,  4,  2,  4,  6,  2 },
671 /* 102:    1, 2,       5, 6,     */  { 0,  2,  4,  4,  2,  6 },
672 /* 204:       2, 3,       6, 7,  */  { 1,  3,  5,  3,  7,  5 },
673 /* 240:             4, 5, 6, 7,  */  { 9, 10,  8, 10, 11,  8 }
674 };
675 //_____________________________________________________________________________
676 
677 static const char tiling9[8][12] = {
678 /*  39: 0, 1, 2,       5,        */  {  2, 10,  5,  3,  2,  5,  3,  5,  4,  3,  4,  8 },
679 /*  27: 0, 1,    3, 4,           */  {  4,  7, 11,  9,  4, 11,  9, 11,  2,  9,  2,  1 },
680 /* 141: 0,    2, 3,          7,  */  { 10,  7,  6,  1,  7, 10,  1,  8,  7,  1,  0,  8 },
681 /* 177: 0,          4, 5,    7,  */  {  3,  6, 11,  0,  6,  3,  0,  5,  6,  0,  9,  5 },
682 /*  78:    1, 2, 3,       6,     */  {  3, 11,  6,  0,  3,  6,  0,  6,  5,  0,  5,  9 },
683 /* 114:    1,       4, 5, 6,     */  { 10,  6,  7,  1, 10,  7,  1,  7,  8,  1,  8,  0 },
684 /* 228:       2,       5, 6, 7,  */  {  4, 11,  7,  9, 11,  4,  9,  2, 11,  9,  1,  2 },
685 /* 216:          3, 4,    6, 7,  */  {  2,  5, 10,  3,  5,  2,  3,  4,  5,  3,  8,  4 }
686 };
687 //_____________________________________________________________________________
688 
689 // 2 faces to test + eventually the interior
690 // When the tests on both specified faces are positive : 4 middle triangles (1)
691 // When the test on the first  specified face is positive : 8 first triangles
692 // When the test on the second specified face is positive : 8 next triangles
693 // When the tests on both specified faces are negative :
694 // - if the test on the interior is negative : 4 middle triangles
695 // - if the test on the interior is positive : 8 last triangles
696 static const char test10[6][3] = {
697 /* 195: 0, 1,             6, 7,  */  {  2,  4,  7 },
698 /*  85: 0,    2,    4,    6,     */  {  5,  6,  7 },
699 /* 105: 0,       3,    5, 6,     */  {  1,  3,  7 },
700 /* 150:    1, 2,    4,       7,  */  {  1,  3,  7 },
701 /* 170:    1,    3,    5,    7,  */  {  5,  6,  7 },
702 /*  60:       2, 3, 4, 5,        */  {  2,  4,  7 }
703 };
704 
705 static const char tiling10[6][96] = {
706 /* 195: 0, 1,             6, 7,  */  {  12,  5,  9, 12,  9,  8, 12,  8,  3, 12,  3,  1, 12,  1, 10, 12, 10, 11, 12, 11,  7, 12,  7,  5,   12,  7,  8, 12,  8,  9, 12,  9,  1, 12,  1,  3, 12,  3, 11, 12, 11, 10, 12, 10,  5, 12,  5,  7,     5, 10,  7, 10,  7, 11,  9,  1,  8,  1,  8,  3,     5,  9,  7,  9,  7,  8, 10,  1, 11,  1, 11,  3,     3, 11,  7,  3,  7,  8,  7,  8,  9,  7,  9,  5,  9,  5, 10,  9, 10,  1, 10,  1,  3, 10,  3, 11 },
707 /*  85: 0,    2,    4,    6,     */  {  12,  1,  0, 12,  0,  4, 12,  4,  7, 12,  7,  3, 12,  3,  2, 12,  2,  6, 12,  6,  5, 12,  5,  1,   12,  5,  4, 12,  4,  0, 12,  0,  3, 12,  3,  7, 12,  7,  6, 12,  6,  2, 12,  2,  1, 12,  1,  5,     1,  2,  5,  2,  5,  6,  0,  3,  4,  3,  4,  7,     3,  2,  7,  2,  7,  6,  0,  1,  4,  1,  4,  5,     7,  6,  5,  7,  5,  4,  5,  4,  0,  5,  0,  1,  0,  1,  2,  0,  2,  3,  2,  3,  7,  2,  7,  6 },
708 /* 105: 0,       3,    5, 6,     */  {  12,  8,  4, 12,  4,  6, 12,  6, 10, 12, 10,  9, 12,  9,  0, 12,  0,  2, 12,  2, 11, 12, 11,  8,   12, 11,  6, 12,  6,  4, 12,  4,  9, 12,  9, 10, 12, 10,  2, 12,  2,  0, 12,  0,  8, 12,  8, 11,     8,  0, 11,  0, 11,  2,  4,  9,  6,  9,  6, 10,     9,  0, 10,  0, 10,  2,  4,  8,  6,  8,  6, 11,    10,  2, 11, 10, 11,  6, 11,  6,  4, 11,  4,  8,  4,  8,  0,  4,  0,  9,  0,  9, 10,  0, 10,  2 },
709 /* 150:    1, 2,    4,       7,  */  {  12,  9,  4, 12,  4,  6, 12,  6, 11, 12, 11,  8, 12,  8,  0, 12,  0,  2, 12,  2, 10, 12, 10,  9,   12, 10,  6, 12,  6,  4, 12,  4,  8, 12,  8, 11, 12, 11,  2, 12,  2,  0, 12,  0,  9, 12,  9, 10,     9,  0, 10,  0, 10,  2,  4,  8,  6,  8,  6, 11,     8,  0, 11,  0, 11,  2,  4,  9,  6,  9,  6, 10,    11,  2, 10, 11, 10,  6, 10,  6,  4, 10,  4,  9,  4,  9,  0,  4,  0,  8,  0,  8, 11,  0, 11,  2 },
710 /* 170:    1,    3,    5,    7,  */  {  12,  3,  0, 12,  0,  4, 12,  4,  5, 12,  5,  1, 12,  1,  2, 12,  2,  6, 12,  6,  7, 12,  7,  3,   12,  7,  4, 12,  4,  0, 12,  0,  1, 12,  1,  5, 12,  5,  6, 12,  6,  2, 12,  2,  3, 12,  3,  7,     3,  2,  7,  2,  7,  6,  0,  1,  4,  1,  4,  5,     1,  2,  5,  2,  5,  6,  0,  3,  4,  3,  4,  7,     5,  6,  7,  5,  7,  4,  7,  4,  0,  7,  0,  3,  0,  3,  2,  0,  2,  1,  2,  1,  5,  2,  5,  6 },
711 /*  60:       2, 3, 4, 5,        */  {  12,  5, 10, 12, 10, 11, 12, 11,  3, 12,  3,  1, 12,  1,  9, 12,  9,  8, 12,  8,  7, 12,  7,  5,   12,  7, 11, 12, 11, 10, 12, 10,  1, 12,  1,  3, 12,  3,  8, 12,  8,  9, 12,  9,  5, 12,  5,  7,     5,  9,  7,  9,  7,  8, 10,  1, 11,  1, 11,  3,     5, 10,  7, 10,  7, 11,  9,  1,  8,  1,  8,  3,     3,  8,  7,  3,  7, 11,  7, 11, 10,  7, 10,  5, 10,  5,  9, 10,  9,  1,  9,  1,  3,  9,  3,  8 }
712 };
713 //_____________________________________________________________________________
714 
715 static const char tiling11[12][12] = {
716 /*  23: 0, 1, 2,    4,           */  { 2, 10,  9,  2,  9,  7,  2,  7,  3,  7,  9,  4 },
717 /* 139: 0, 1,    3,          7,  */  { 1,  6,  2,  1,  8,  6,  1,  9,  8,  8,  7,  6 },
718 /*  99: 0, 1,          5, 6,     */  { 8,  3,  1,  8,  1,  6,  8,  6,  4,  6,  1, 10 },
719 /*  77: 0,    2, 3,       6,     */  { 0,  8, 11,  0, 11,  5,  0,  5,  1,  5, 11,  6 },
720 /*  57: 0,       3, 4, 5,        */  { 9,  5,  7,  9,  7,  2,  9,  2,  0,  2,  7, 11 },
721 /* 209: 0,          4,    6, 7,  */  { 5,  0,  4,  5, 11,  0,  5, 10, 11, 11,  3,  0 },
722 /*  46:    1, 2, 3,    5,        */  { 5,  4,  0,  5,  0, 11,  5, 11, 10, 11,  0,  3 },
723 /* 198:    1, 2,          6, 7,  */  { 9,  7,  5,  9,  2,  7,  9,  0,  2,  2, 11,  7 },
724 /* 178:    1,       4, 5,    7,  */  { 0, 11,  8,  0,  5, 11,  0,  1,  5,  5,  6, 11 },
725 /* 156:       2, 3, 4,       7,  */  { 8,  1,  3,  8,  6,  1,  8,  4,  6,  6, 10,  1 },
726 /* 116:       2,    4, 5, 6,     */  { 1,  2,  6,  1,  6,  8,  1,  8,  9,  8,  6,  7 },
727 /* 232:          3,    5, 6, 7,  */  { 2,  9, 10,  2,  7,  9,  2,  3,  7,  7,  4,  9 }
728 };
729 //_____________________________________________________________________________
730 
731 // 2 faces to test + eventually the interior
732 // When the tests on both specified faces are positive : 4 middle triangles (1)
733 // When the test on the first  specified face is positive : 8 first triangles
734 // When the test on the second specified face is positive : 8 next triangles
735 // When the tests on both specified faces are negative :
736 // - if the test on the interior is negative : 4 middle triangles
737 // - if the test on the interior is positive : 8 last triangles
738 
739 static const char test12[24][3] = {
740 /* 135: 0, 1, 2,             7,  */  {  4,  3,  7 },
741 /*  75: 0, 1,    3,       6,     */  {  3,  2,  7 },
742 /*  83: 0, 1,       4,    6,     */  {  2,  6,  7 },
743 /* 163: 0, 1,          5,    7,  */  {  6,  4,  7 },
744 /*  45: 0,    2, 3,    5,        */  {  2,  1,  7 },
745 /*  53: 0,    2,    4, 5,        */  {  5,  2,  7 },
746 /* 149: 0,    2,    4,       7,  */  {  5,  3,  7 },
747 /* 101: 0,    2,       5, 6,     */  {  5,  1,  7 },
748 /* 197: 0,    2,          6, 7,  */  {  5,  4,  7 },
749 /*  89: 0,       3, 4,    6,     */  {  6,  3,  7 },
750 /* 169: 0,       3,    5,    7,  */  {  1,  6,  7 },
751 /* 225: 0,             5, 6, 7,  */  {  1,  4,  7 },
752 /*  30:    1, 2, 3, 4,           */  {  4,  1,  7 },
753 /*  86:    1, 2,    4,    6,     */  {  6,  1,  7 },
754 /* 166:    1, 2,       5,    7,  */  {  3,  6,  7 },
755 /*  58:    1,    3, 4, 5,        */  {  4,  5,  7 },
756 /* 154:    1,    3, 4,       7,  */  {  1,  5,  7 },
757 /* 106:    1,    3,    5, 6,     */  {  3,  5,  7 },
758 /* 202:    1,    3,       6, 7,  */  {  2,  5,  7 },
759 /* 210:    1,       4,    6, 7,  */  {  1,  2,  7 },
760 /*  92:       2, 3, 4,    6,     */  {  4,  6,  7 },
761 /* 172:       2, 3,    5,    7,  */  {  6,  2,  7 },
762 /* 180:       2,    4, 5,    7,  */  {  2,  3,  7 },
763 /* 120:          3, 4, 5, 6,     */  {  3,  4,  7 }
764 };
765 
766 static const char tiling12[24][96] = {
767 /* 135: 0, 1, 2,             7,  */  {  12,  8,  9, 12,  9, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8,   12,  2, 11, 12, 11,  7, 12,  7,  6, 12,  6, 10, 12, 10,  9, 12,  9,  8, 12,  8,  3, 12,  3,  2,     7,  6, 11,  2,  3, 10,  3, 10,  8, 10,  8,  9,     3,  2, 11,  6,  7, 10,  7, 10,  8, 10,  8,  9,    11,  3,  7,  3,  7,  8,  7,  8,  9,  7,  9,  6,  9,  6, 10,  6, 10,  2,  6,  2, 11,  2, 11,  3 },
768 /*  75: 0, 1,    3,       6,     */  {  12, 11,  8, 12,  8,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11,   12,  1, 10, 12, 10,  6, 12,  6,  5, 12,  5,  9, 12,  9,  8, 12,  8, 11, 12, 11,  2, 12,  2,  1,     6,  5, 10,  1,  2,  9,  2,  9, 11,  9, 11,  8,     2,  1, 10,  5,  6,  9,  6,  9, 11,  9, 11,  8,    10,  2,  6,  2,  6, 11,  6, 11,  8,  6,  8,  5,  8,  5,  9,  5,  9,  1,  5,  1, 10,  1, 10,  2 },
769 /*  83: 0, 1,       4,    6,     */  {  12,  1,  3, 12,  3,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1,   12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7,  3, 12,  3,  1, 12,  1,  9, 12,  9,  4,    10,  6,  5,  4,  9,  7,  9,  7,  1,  7,  1,  3,     9,  4,  5,  6, 10,  7, 10,  7,  1,  7,  1,  3,     5,  9, 10,  9, 10,  1, 10,  1,  3, 10,  3,  6,  3,  6,  7,  6,  7,  4,  6,  4,  5,  4,  5,  9 },
770 /* 163: 0, 1,          5,    7,  */  {  12,  3,  1, 12,  1,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3,   12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  1, 12,  1,  3, 12,  3, 11, 12, 11,  6,    11,  6,  7,  4,  8,  5,  8,  5,  3,  5,  3,  1,     8,  4,  7,  6, 11,  5, 11,  5,  3,  5,  3,  1,     7,  8, 11,  8, 11,  3, 11,  3,  1, 11,  1,  6,  1,  6,  5,  6,  5,  4,  6,  4,  7,  4,  7,  8 },
771 /*  45: 0,    2, 3,    5,        */  {  12, 10, 11, 12, 11,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10,   12,  0,  9, 12,  9,  5, 12,  5,  4, 12,  4,  8, 12,  8, 11, 12, 11, 10, 12, 10,  1, 12,  1,  0,     5,  4,  9,  0,  1,  8,  1,  8, 10,  8, 10, 11,     1,  0,  9,  4,  5,  8,  5,  8, 10,  8, 10, 11,     9,  1,  5,  1,  5, 10,  5, 10, 11,  5, 11,  4, 11,  4,  8,  4,  8,  0,  4,  0,  9,  0,  9,  1 },
772 /*  53: 0,    2,    4, 5,        */  {  12,  5,  7, 12,  7,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5,   12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  7, 12,  7,  5, 12,  5, 10, 12, 10,  2,    10,  2,  1,  0,  9,  3,  9,  3,  5,  3,  5,  7,     9,  0,  1,  2, 10,  3, 10,  3,  5,  3,  5,  7,     1,  9, 10,  9, 10,  5, 10,  5,  7, 10,  7,  2,  7,  2,  3,  2,  3,  0,  2,  0,  1,  0,  1,  9 },
773 /* 149: 0,    2,    4,       7,  */  {  12,  6,  4, 12,  4,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6,   12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  4, 12,  4,  6, 12,  6, 10, 12, 10,  1,    10,  1,  2,  3, 11,  0, 11,  0,  6,  0,  6,  4,    11,  3,  2,  1, 10,  0, 10,  0,  6,  0,  6,  4,     2, 11, 10, 11, 10,  6, 10,  6,  4, 10,  4,  1,  4,  1,  0,  1,  0,  3,  1,  3,  2,  3,  2, 11 },
774 /* 101: 0,    2,       5, 6,     */  {  12,  4,  6, 12,  6,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4,   12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2,  6, 12,  6,  4, 12,  4,  8, 12,  8,  3,     8,  3,  0,  1,  9,  2,  9,  2,  4,  2,  4,  6,     9,  1,  0,  3,  8,  2,  8,  2,  4,  2,  4,  6,     0,  9,  8,  9,  8,  4,  8,  4,  6,  8,  6,  3,  6,  3,  2,  3,  2,  1,  3,  1,  0,  1,  0,  9 },
775 /* 197: 0,    2,          6, 7,  */  {  12,  7,  5, 12,  5,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7,   12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1,  5, 12,  5,  7, 12,  7,  8, 12,  8,  0,     8,  0,  3,  2, 11,  1, 11,  1,  7,  1,  7,  5,    11,  2,  3,  0,  8,  1,  8,  1,  7,  1,  7,  5,     3, 11,  8, 11,  8,  7,  8,  7,  5,  8,  5,  0,  5,  0,  1,  0,  1,  2,  0,  2,  3,  2,  3, 11 },
776 /*  89: 0,       3, 4,    6,     */  {  12,  2,  0, 12,  0,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2,   12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  0, 12,  0,  2, 12,  2, 10, 12, 10,  5,    10,  5,  6,  7, 11,  4, 11,  4,  2,  4,  2,  0,    11,  7,  6,  5, 10,  4, 10,  4,  2,  4,  2,  0,     6, 11, 10, 11, 10,  2, 10,  2,  0, 10,  0,  5,  0,  5,  4,  5,  4,  7,  5,  7,  6,  7,  6, 11 },
777 /* 169: 0,       3,    5,    7,  */  {  12,  0,  2, 12,  2,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0,   12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6,  2, 12,  2,  0, 12,  0,  8, 12,  8,  7,     9,  5,  4,  7,  8,  6,  8,  6,  0,  6,  0,  2,     8,  7,  4,  5,  9,  6,  9,  6,  0,  6,  0,  2,     4,  8,  9,  8,  9,  0,  9,  0,  2,  9,  2,  5,  2,  5,  6,  5,  6,  7,  5,  7,  4,  7,  4,  8 },
778 /* 225: 0,             5, 6, 7,  */  {  12,  9, 10, 12, 10, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9,   12,  7,  8, 12,  8,  0, 12,  0,  3, 12,  3, 11, 12, 11, 10, 12, 10,  9, 12,  9,  4, 12,  4,  7,     0,  3,  8,  7,  4, 11,  4, 11,  9, 11,  9, 10,     4,  7,  8,  3,  0, 11,  0, 11,  9, 11,  9, 10,     8,  4,  0,  4,  0,  9,  0,  9, 10,  0, 10,  3, 10,  3, 11,  3, 11,  7,  3,  7,  8,  7,  8,  4 },
779 /*  30:    1, 2, 3, 4,           */  {  12,  9, 10, 12, 10, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9,   12,  7,  8, 12,  8,  0, 12,  0,  3, 12,  3, 11, 12, 11, 10, 12, 10,  9, 12,  9,  4, 12,  4,  7,     4,  7,  8,  3,  0, 11,  0, 11,  9, 11,  9, 10,     0,  3,  8,  7,  4, 11,  4, 11,  9, 11,  9, 10,     8,  0,  4,  0,  4,  9,  4,  9, 10,  4, 10,  7, 10,  7, 11,  7, 11,  3,  7,  3,  8,  3,  8,  0 },
780 /*  86:    1, 2,    4,    6,     */  {  12,  0,  2, 12,  2,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0,   12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6,  2, 12,  2,  0, 12,  0,  8, 12,  8,  7,     8,  7,  4,  5,  9,  6,  9,  6,  0,  6,  0,  2,     9,  5,  4,  7,  8,  6,  8,  6,  0,  6,  0,  2,     4,  9,  8,  9,  8,  0,  8,  0,  2,  8,  2,  7,  2,  7,  6,  7,  6,  5,  7,  5,  4,  5,  4,  9 },
781 /* 166:    1, 2,       5,    7,  */  {  12,  2,  0, 12,  0,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2,   12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  0, 12,  0,  2, 12,  2, 10, 12, 10,  5,    11,  7,  6,  5, 10,  4, 10,  4,  2,  4,  2,  0,    10,  5,  6,  7, 11,  4, 11,  4,  2,  4,  2,  0,     6, 10, 11, 10, 11,  2, 11,  2,  0, 11,  0,  7,  0,  7,  4,  7,  4,  5,  7,  5,  6,  5,  6, 10 },
782 /*  58:    1,    3, 4, 5,        */  {  12,  7,  5, 12,  5,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7,   12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1,  5, 12,  5,  7, 12,  7,  8, 12,  8,  0,    11,  2,  3,  0,  8,  1,  8,  1,  7,  1,  7,  5,     8,  0,  3,  2, 11,  1, 11,  1,  7,  1,  7,  5,     3,  8, 11,  8, 11,  7, 11,  7,  5, 11,  5,  2,  5,  2,  1,  2,  1,  0,  2,  0,  3,  0,  3,  8 },
783 /* 154:    1,    3, 4,       7,  */  {  12,  4,  6, 12,  6,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4,   12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2,  6, 12,  6,  4, 12,  4,  8, 12,  8,  3,     9,  1,  0,  3,  8,  2,  8,  2,  4,  2,  4,  6,     8,  3,  0,  1,  9,  2,  9,  2,  4,  2,  4,  6,     0,  8,  9,  8,  9,  4,  9,  4,  6,  9,  6,  1,  6,  1,  2,  1,  2,  3,  1,  3,  0,  3,  0,  8 },
784 /* 106:    1,    3,    5, 6,     */  {  12,  6,  4, 12,  4,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6,   12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  4, 12,  4,  6, 12,  6, 10, 12, 10,  1,    11,  3,  2,  1, 10,  0, 10,  0,  6,  0,  6,  4,    10,  1,  2,  3, 11,  0, 11,  0,  6,  0,  6,  4,     2, 10, 11, 10, 11,  6, 11,  6,  4, 11,  4,  3,  4,  3,  0,  3,  0,  1,  3,  1,  2,  1,  2, 10 },
785 /* 202:    1,    3,       6, 7,  */  {  12,  5,  7, 12,  7,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5,   12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  7, 12,  7,  5, 12,  5, 10, 12, 10,  2,     9,  0,  1,  2, 10,  3, 10,  3,  5,  3,  5,  7,    10,  2,  1,  0,  9,  3,  9,  3,  5,  3,  5,  7,     1, 10,  9, 10,  9,  5,  9,  5,  7,  9,  7,  0,  7,  0,  3,  0,  3,  2,  0,  2,  1,  2,  1, 10 },
786 /* 210:    1,       4,    6, 7,  */  {  12, 10, 11, 12, 11,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10,   12,  0,  9, 12,  9,  5, 12,  5,  4, 12,  4,  8, 12,  8, 11, 12, 11, 10, 12, 10,  1, 12,  1,  0,     1,  0,  9,  4,  5,  8,  5,  8, 10,  8, 10, 11,     5,  4,  9,  0,  1,  8,  1,  8, 10,  8, 10, 11,     9,  5,  1,  5,  1, 10,  1, 10, 11,  1, 11,  0, 11,  0,  8,  0,  8,  4,  0,  4,  9,  4,  9,  5 },
787 /*  92:       2, 3, 4,    6,     */  {  12,  3,  1, 12,  1,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3,   12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  1, 12,  1,  3, 12,  3, 11, 12, 11,  6,     8,  4,  7,  6, 11,  5, 11,  5,  3,  5,  3,  1,    11,  6,  7,  4,  8,  5,  8,  5,  3,  5,  3,  1,     7, 11,  8, 11,  8,  3,  8,  3,  1,  8,  1,  4,  1,  4,  5,  4,  5,  6,  4,  6,  7,  6,  7, 11 },
788 /* 172:       2, 3,    5,    7,  */  {  12,  1,  3, 12,  3,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1,   12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7,  3, 12,  3,  1, 12,  1,  9, 12,  9,  4,     9,  4,  5,  6, 10,  7, 10,  7,  1,  7,  1,  3,    10,  6,  5,  4,  9,  7,  9,  7,  1,  7,  1,  3,     5, 10,  9, 10,  9,  1,  9,  1,  3,  9,  3,  4,  3,  4,  7,  4,  7,  6,  4,  6,  5,  6,  5, 10 },
789 /* 180:       2,    4, 5,    7,  */  {  12, 11,  8, 12,  8,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11,   12,  1, 10, 12, 10,  6, 12,  6,  5, 12,  5,  9, 12,  9,  8, 12,  8, 11, 12, 11,  2, 12,  2,  1,     2,  1, 10,  5,  6,  9,  6,  9, 11,  9, 11,  8,     6,  5, 10,  1,  2,  9,  2,  9, 11,  9, 11,  8,    10,  6,  2,  6,  2, 11,  2, 11,  8,  2,  8,  1,  8,  1,  9,  1,  9,  5,  1,  5, 10,  5, 10,  6 },
790 /* 120:          3, 4, 5, 6,     */  {  12,  8,  9, 12,  9, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8,   12,  2, 11, 12, 11,  7, 12,  7,  6, 12,  6, 10, 12, 10,  9, 12,  9,  8, 12,  8,  3, 12,  3,  2,     3,  2, 11,  6,  7, 10,  7, 10,  8, 10,  8,  9,     7,  6, 11,  2,  3, 10,  3, 10,  8, 10,  8,  9,    11,  7,  3,  7,  3,  8,  3,  8,  9,  3,  9,  2,  9,  2, 10,  2, 10,  6,  2,  6, 11,  6, 11,  7 }
791 };
792 //_____________________________________________________________________________
793 
794 
795 /* 13: face test */
796 static const char test13[2][7] = {
797 /* 165: 0,    2,       5,    7,  */  { 1,2,3,4,5,6,7 },
798 /*  90:    1,    3, 4,    6,     */  { 2,3,4,1,5,6,7 },
799 };
800 
801 
802 /* 13: sub configs */
803 static const char subconfig13[64] = {
804 /*  0: 0,0,0,0,0,0 */   0,
805 /*  1: 1,0,0,0,0,0 */   1,
806 /*  2: 0,1,0,0,0,0 */   2,
807 /*  3: 1,1,0,0,0,0 */   7,
808 /*  4: 0,0,1,0,0,0 */   3,
809 /*  5: 1,0,1,0,0,0 */  -1,
810 /*  6: 0,1,1,0,0,0 */  11,
811 /*  7: 1,1,1,0,0,0 */  -1,
812 /*  8: 0,0,0,1,0,0 */   4,
813 /*  9: 1,0,0,1,0,0 */   8,
814 /* 10: 0,1,0,1,0,0 */  -1,
815 /* 11: 1,1,0,1,0,0 */  -1,
816 /* 12: 0,0,1,1,0,0 */  14,
817 /* 13: 1,0,1,1,0,0 */  -1,
818 /* 14: 0,1,1,1,0,0 */  -1,
819 /* 15: 1,1,1,1,0,0 */  -1,
820 /* 16: 0,0,0,0,1,0 */   5,
821 /* 17: 1,0,0,0,1,0 */   9,
822 /* 18: 0,1,0,0,1,0 */  12,
823 /* 19: 1,1,0,0,1,0 */  23,
824 /* 20: 0,0,1,0,1,0 */  15,
825 /* 21: 1,0,1,0,1,0 */  -1,
826 /* 22: 0,1,1,0,1,0 */  21,
827 /* 23: 1,1,1,0,1,0 */  38,
828 /* 24: 0,0,0,1,1,0 */  17,
829 /* 25: 1,0,0,1,1,0 */  20,
830 /* 26: 0,1,0,1,1,0 */  -1,
831 /* 27: 1,1,0,1,1,0 */  36,
832 /* 28: 0,0,1,1,1,0 */  26,
833 /* 29: 1,0,1,1,1,0 */  33,
834 /* 30: 0,1,1,1,1,0 */  30,
835 /* 31: 1,1,1,1,1,0 */  44,
836 /* 32: 0,0,0,0,0,1 */   6,
837 /* 33: 1,0,0,0,0,1 */  10,
838 /* 34: 0,1,0,0,0,1 */  13,
839 /* 35: 1,1,0,0,0,1 */  19,
840 /* 36: 0,0,1,0,0,1 */  16,
841 /* 37: 1,0,1,0,0,1 */  -1,
842 /* 38: 0,1,1,0,0,1 */  25,
843 /* 39: 1,1,1,0,0,1 */  37,
844 /* 40: 0,0,0,1,0,1 */  18,
845 /* 41: 1,0,0,1,0,1 */  24,
846 /* 42: 0,1,0,1,0,1 */  -1,
847 /* 43: 1,1,0,1,0,1 */  35,
848 /* 44: 0,0,1,1,0,1 */  22,
849 /* 45: 1,0,1,1,0,1 */  32,
850 /* 46: 0,1,1,1,0,1 */  29,
851 /* 47: 1,1,1,1,0,1 */  43,
852 /* 48: 0,0,0,0,1,1 */  -1,
853 /* 49: 1,0,0,0,1,1 */  -1,
854 /* 50: 0,1,0,0,1,1 */  -1,
855 /* 51: 1,1,0,0,1,1 */  34,
856 /* 52: 0,0,1,0,1,1 */  -1,
857 /* 53: 1,0,1,0,1,1 */  -1,
858 /* 54: 0,1,1,0,1,1 */  28,
859 /* 55: 1,1,1,0,1,1 */  42,
860 /* 56: 0,0,0,1,1,1 */  -1,
861 /* 57: 1,0,0,1,1,1 */  31,
862 /* 58: 0,1,0,1,1,1 */  -1,
863 /* 59: 1,1,0,1,1,1 */  41,
864 /* 60: 0,0,1,1,1,1 */  27,
865 /* 61: 1,0,1,1,1,1 */  40,
866 /* 62: 0,1,1,1,1,1 */  39,
867 /* 63: 1,1,1,1,1,1 */  45,
868 };
869 
870 
871 
872 /* 13.1 */
873 static const char tiling13_1[2][12] = {
874 /* 165: 0,    2,       5,    7,  */  { 6,7,11,1,2,10,0,3,8,4,5,9 },
875 /*  90:    1,    3, 4,    6,     */  { 7,4,8,2,3,11,1,0,9,5,6,10 }
876 };
877 
878 
879 
880 /* 13.2 */
881 static const char tiling13_2[2][6][18] = {
882 /* 165: 0,    2,       5,    7,  */  {
883 /* 1 */ { 1,2,10,6,7,11,8,4,3,4,3,5,3,5,0,5,0,9 },
884 /* 2 */ { 0,3,8,6,7,11,9,1,4,1,4,2,4,2,5,2,5,10 },
885 /* 3 */ { 4,5,9,0,3,8,10,6,1,6,1,7,1,7,2,7,2,11 },
886 /* 4 */ { 4,5,9,1,2,10,11,3,6,3,6,0,6,0,7,0,7,8 },
887 /* 5 */ { 4,5,9,6,7,11,1,10,0,10,0,8,10,8,2,8,2,3 },
888 /* 6 */ { 1,2,10,3,0,8,4,9,7,9,7,11,9,11,5,11,5,6 }
889 },
890 /*  90:    1,    3, 4,    6,     */  {
891 /* 1 */ { 2,3,11,7,4,8,9,5,0,5,0,6,0,6,1,6,1,10 },
892 /* 2 */ { 1,0,9,7,4,8,10,2,5,2,5,3,5,3,6,3,6,11 },
893 /* 3 */ { 5,6,10,1,0,9,11,7,2,7,2,4,2,4,3,4,3,8 },
894 /* 4 */ { 5,6,10,2,3,11,8,0,7,0,7,1,7,1,4,1,4,9 },
895 /* 5 */ { 5,6,10,7,4,8,2,11,1,11,1,9,11,9,3,9,3,0 },
896 /* 6 */ { 2,3,11,0,1,9,5,10,4,10,4,8,10,8,6,8,6,7 }
897 } };
898 
899 
900 
901 /* 13.3 */
902 static const char tiling13_3[2][12][30] = {
903 /* 165: 0,    2,       5,    7,  */  {
904 /* 1,2 */ { 6,7,11,12,2,10,12,10,5,12,5,4,12,4,8,12,8,3,12,3,0,12,0,9,12,9,1,12,1,2 },
905 /* 1,4 */ { 1,2,10,12,5,9,12,9,0,12,0,3,12,3,11,12,11,6,12,6,7,12,7,8,12,8,4,12,4,5 },
906 /* 1,5 */ { 6,7,11,12,5,4,12,4,8,12,8,3,12,3,2,12,2,10,12,10,1,12,1,0,12,0,9,12,9,5 },
907 /* 1,6 */ { 1,2,10,12,3,0,12,0,9,12,9,5,12,5,6,12,6,11,12,11,7,12,7,4,12,4,8,12,8,3 },
908 /* 2,3 */ { 0,3,8,12,7,11,12,11,2,12,2,1,12,1,9,12,9,4,12,4,5,12,5,10,12,10,6,12,6,7 },
909 /* 2,5 */ { 6,7,11,12,4,5,12,5,10,12,10,2,12,2,3,12,3,8,12,8,0,12,0,1,12,1,9,12,9,4 },
910 /* 2,6 */ { 0,3,8,12,2,1,12,1,9,12,9,4,12,4,7,12,7,11,12,11,6,12,6,5,12,5,10,12,10,2 },
911 /* 3,4 */ { 4,5,9,12,0,8,12,8,7,12,7,6,12,6,10,12,10,1,12,1,2,12,2,11,12,11,3,12,3,0 },
912 /* 3,5 */ { 4,5,9,12,7,6,12,6,10,12,10,1,12,1,0,12,0,8,12,8,3,12,3,2,12,2,11,12,11,7 },
913 /* 3,6 */ { 0,3,8,12,1,2,12,2,11,12,11,7,12,7,4,12,4,9,12,9,5,12,5,6,12,6,10,12,10,1 },
914 /* 4,5 */ { 4,5,9,12,6,7,12,7,8,12,8,0,12,0,1,12,1,10,12,10,2,12,2,3,12,3,11,12,11,6 },
915 /* 4,6 */ { 1,2,10,12,0,3,12,3,11,12,11,6,12,6,5,12,5,9,12,9,4,12,4,7,12,7,8,12,8,0 }
916 },
917 /*  90:    1,    3, 4,    6,     */  {
918 /* 1,2 */ { 7,4,8,12,3,11,12,11,6,12,6,5,12,5,9,12,9,0,12,0,1,12,1,10,12,10,2,12,2,3 },
919 /* 1,4 */ { 2,3,11,12,6,10,12,10,1,12,1,0,12,0,8,12,8,7,12,7,4,12,4,9,12,9,5,12,5,6 },
920 /* 1,5 */ { 7,4,8,12,6,5,12,5,9,12,9,0,12,0,3,12,3,11,12,11,2,12,2,1,12,1,10,12,10,6 },
921 /* 1,6 */ { 2,3,11,12,0,1,12,1,10,12,10,6,12,6,7,12,7,8,12,8,4,12,4,5,12,5,9,12,9,0 },
922 /* 2,3 */ { 0,1,9,12,4,8,12,8,3,12,3,2,12,2,10,12,10,5,12,5,6,12,6,11,12,11,7,12,7,4 },
923 /* 2,5 */ { 7,4,8,12,5,6,12,6,11,12,11,3,12,3,0,12,0,9,12,9,1,12,1,2,12,2,10,12,10,5 },
924 /* 2,6 */ { 1,0,9,12,3,2,12,2,10,12,10,5,12,5,4,12,4,8,12,8,7,12,7,6,12,6,11,12,11,3 },
925 /* 3,4 */ { 5,6,10,12,1,9,12,9,4,12,4,7,12,7,11,12,11,2,12,2,3,12,3,8,12,8,0,12,0,1 },
926 /* 3,5 */ { 5,6,10,12,4,7,12,7,11,12,11,2,12,2,1,12,1,9,12,9,0,12,0,3,12,3,8,12,8,4 },
927 /* 3,6 */ { 1,0,9,12,2,3,12,3,8,12,8,4,12,4,5,12,5,10,12,10,6,12,6,7,12,7,11,12,11,2 },
928 /* 4,5 */ { 5,6,10,12,7,4,12,4,9,12,9,1,12,1,2,12,2,11,12,11,3,12,3,0,12,0,8,12,8,7 },
929 /* 4,6 */ { 2,3,11,12,1,0,12,0,8,12,8,7,12,7,6,12,6,10,12,10,5,12,5,4,12,4,9,12,9,1 }
930 } };
931 
932 
933 
934 /* 13.4 */
935 static const char tiling13_4[2][4][36] = {
936 /* 165: 0,    2,       5,    7,  */  {
937 /* 1,2,6 */ { 12,2,10,12,10,5,12,5,6,12,6,11,12,11,7,12,7,4,12,4,8,12,8,3,12,3,0,12,0,9,12,9,1,12,1,2 },
938 /* 1,4,5 */ { 12,3,11,12,11,6,12,6,7,12,7,8,12,8,4,12,4,5,12,5,9,12,9,0,12,0,1,12,1,10,12,10,2,12,2,3 },
939 /* 2,3,5 */ { 12,1,9,12,9,4,12,4,5,12,5,10,12,10,6,12,6,7,12,7,11,12,11,2,12,2,3,12,3,8,12,8,0,12,0,1 },
940 /* 3,4,6 */ { 12,0,8,12,8,7,12,7,4,12,4,9,12,9,5,12,5,6,12,6,10,12,10,1,12,1,2,12,2,11,12,11,3,12,3,0 }
941 },
942 /*  90:    1,    3, 4,    6,     */  {
943 /* 1,2,6 */ { 12,3,11,12,11,6,12,6,7,12,7,8,12,8,4,12,4,5,12,5,9,12,9,0,12,0,1,12,1,10,12,10,2,12,2,3 },
944 /* 1,4,5 */ { 12,0,8,12,8,7,12,7,4,12,4,9,12,9,5,12,5,6,12,6,10,12,10,1,12,1,2,12,2,11,12,11,3,12,3,0 },
945 /* 2,3,5 */ { 12,2,10,12,10,5,12,5,6,12,6,11,12,11,7,12,7,4,12,4,8,12,8,3,12,3,0,12,0,9,12,9,1,12,1,2 },
946 /* 3,4,6 */ { 12,1,9,12,9,4,12,4,5,12,5,10,12,10,6,12,6,7,12,7,11,12,11,2,12,2,3,12,3,8,12,8,0,12,0,1 }
947 } };
948 
949 
950 
951 /* 13.5.1 */
952 static const char tiling13_5_1[2][4][18] = {
953 /* 165: 0,    2,       5,    7,  */  {
954 /* 1,2,5 */ { 6,7,11,1,0,9,2,3,10,3,10,5,3,5,8,5,8,4 },
955 /* 1,4,6 */ { 2,1,10,7,4,8,3,0,11,0,11,6,0,6,9,6,9,5 },
956 /* 2,3,6 */ { 0,3,8,5,6,10,1,2,9,2,9,4,2,4,11,4,11,7 },
957 /* 3,4,5 */ { 4,5,9,3,2,11,0,1,8,1,8,7,1,7,10,7,10,6 }
958 },
959 /*  90:    1,    3, 4,    6,     */  {
960 /* 1,2,5 */ { 7,4,8,2,1,10,3,0,11,0,11,6,0,6,9,6,9,5 },
961 /* 1,4,6 */ { 3,2,11,4,5,9,0,1,8,1,8,7,1,7,10,7,10,6 },
962 /* 2,3,6 */ { 1,0,9,6,7,11,2,3,10,3,10,5,3,5,8,5,8,4 },
963 /* 3,4,5 */ { 5,6,10,0,3,8,1,2,9,2,9,4,2,4,11,4,11,7 }
964 } };
965 
966 
967 
968 /* 13.5.2 */
969 static const char tiling13_5_2[2][4][30] = {
970 /* 165: 0,    2,       5,    7,  */  {
971 /* 1,2,5 */ { 0,1,9,7,4,8,7,8,3,7,3,11,3,11,2,11,2,10,11,10,6,10,6,5,6,5,7,5,7,4 },
972 /* 1,4,6 */ { 7,4,8,2,3,11,2,11,6,2,6,10,6,10,5,10,5,9,10,9,1,9,1,0,1,0,2,0,2,3 },
973 /* 2,3,6 */ { 5,6,10,0,1,9,0,9,4,0,4,8,4,8,7,8,7,11,8,11,3,11,3,2,3,2,0,2,0,1 },
974 /* 3,4,5 */ { 2,3,11,5,6,10,5,10,1,5,1,9,1,9,0,9,0,8,9,8,4,4,8,7,4,7,5,7,5,6 }
975 },
976 /*  90:    1,    3, 4,    6,     */  {
977 /* 1,2,5 */ { 1,2,10,4,5,9,4,9,0,4,0,8,0,8,3,8,3,11,8,11,7,11,7,6,7,6,4,6,4,5 },
978 /* 1,4,6 */ { 4,5,9,3,0,8,3,8,7,3,7,11,7,11,6,11,6,10,11,10,2,10,2,1,2,1,3,1,3,0 },
979 /* 2,3,6 */ { 6,7,11,1,2,10,1,10,5,1,5,9,5,9,4,9,4,8,9,8,0,8,0,3,0,3,1,3,1,2 },
980 /* 3,4,5 */ { 3,0,8,6,7,11,6,11,2,6,2,10,2,10,1,10,1,9,10,9,5,5,9,4,5,4,6,4,6,7 }
981 } };
982 
983 
984 
985 /* 13.3 */
986 static const char tiling13_3_[2][12][30] = {
987 /* 165: 0,    2,       5,    7,  */  {
988 /* 1,2 */ { 3,2,11,12,7,8,12,8,0,12,0,1,12,1,10,12,10,6,12,6,5,12,5,9,12,9,4,12,4,7 },
989 /* 1,4 */ { 6,5,10,12,2,11,12,11,7,12,7,4,12,4,9,12,9,1,12,1,0,12,0,8,12,8,3,12,3,2 },
990 /* 1,5 */ { 5,6,10,12,7,4,12,4,9,12,9,1,12,1,2,12,2,11,12,11,3,12,3,0,12,0,8,12,8,7 },
991 /* 1,6 */ { 2,3,11,12,1,0,12,0,8,12,8,7,12,7,6,12,6,10,12,10,5,12,5,4,12,4,9,12,9,1 },
992 /* 2,3 */ { 7,4,8,12,3,11,12,11,6,12,6,5,12,5,9,12,9,0,12,0,1,12,1,10,12,10,2,12,2,3 },
993 /* 2,5 */ { 7,4,8,12,6,5,12,5,9,12,9,0,12,0,3,12,3,11,12,11,2,12,2,1,12,1,10,12,10,6 },
994 /* 2,6 */ { 2,3,11,12,0,1,12,1,10,12,10,6,12,6,7,12,7,8,12,8,4,12,4,5,12,5,9,12,9,0 },
995 /* 3,4 */ { 1,0,9,12,4,8,12,8,3,12,3,2,12,2,10,12,10,5,12,5,6,12,6,11,12,11,7,12,7,4 },
996 /* 3,5 */ { 7,4,8,12,5,6,12,6,11,12,11,3,12,3,0,12,0,9,12,9,1,12,1,2,12,2,10,12,10,5 },
997 /* 3,6 */ { 1,0,9,12,3,2,12,2,10,12,10,5,12,5,4,12,4,8,12,8,7,12,7,6,12,6,11,12,11,3 },
998 /* 4,5 */ { 5,6,10,12,4,7,12,7,11,12,11,2,12,2,1,12,1,9,12,9,0,12,0,3,12,3,8,12,8,4 },
999 /* 4,6 */ { 0,1,9,12,2,3,12,3,8,12,8,4,12,4,5,12,5,10,12,10,6,12,6,7,12,7,11,12,11,2 }
1000 },
1001 /*  90:    1,    3, 4,    6,     */  {
1002 /* 1,2 */ { 0,3,8,12,4,9,12,9,1,12,1,2,12,2,11,12,11,7,12,7,6,12,6,10,12,10,5,12,5,4 },
1003 /* 1,4 */ { 7,6,11,12,3,8,12,8,4,12,4,5,12,5,10,12,10,2,12,2,1,12,1,9,12,9,0,12,0,3 },
1004 /* 1,5 */ { 6,7,11,12,4,5,12,5,10,12,10,2,12,2,3,12,3,8,12,8,0,12,0,1,12,1,9,12,9,4 },
1005 /* 1,6 */ { 3,0,8,12,2,1,12,1,9,12,9,4,12,4,7,12,7,11,12,11,6,12,6,5,12,5,10,12,10,2 },
1006 /* 2,3 */ { 4,5,9,12,0,8,12,8,7,12,7,6,12,6,10,12,10,1,12,1,2,12,2,11,12,11,3,12,3,0 },
1007 /* 2,5 */ { 4,5,9,12,7,6,12,6,10,12,10,1,12,1,0,12,0,8,12,8,3,12,3,2,12,2,11,12,11,7 },
1008 /* 2,6 */ { 3,0,8,12,1,2,12,2,11,12,11,7,12,7,4,12,4,9,12,9,5,12,5,6,12,6,10,12,10,1 },
1009 /* 3,4 */ { 2,1,10,12,5,9,12,9,0,12,0,3,12,3,11,12,11,6,12,6,7,12,7,8,12,8,4,12,4,5 },
1010 /* 3,5 */ { 4,5,9,12,6,7,12,7,8,12,8,0,12,0,1,12,1,10,12,10,2,12,2,3,12,3,11,12,11,6 },
1011 /* 3,6 */ { 2,1,10,12,0,3,12,3,11,12,11,6,12,6,5,12,5,9,12,9,4,12,4,7,12,7,8,12,8,0 },
1012 /* 4,5 */ { 6,7,11,12,5,4,12,4,8,12,8,3,12,3,2,12,2,10,12,10,1,12,1,0,12,0,9,12,9,5 },
1013 /* 4,6 */ { 1,2,10,12,3,0,12,0,9,12,9,5,12,5,6,12,6,11,12,11,7,12,7,4,12,4,8,12,8,3 }
1014 } };
1015 
1016 
1017 
1018 /* 13.2 */
1019 static const char tiling13_2_[2][6][18] = {
1020 /* 165: 0,    2,       5,    7,  */  {
1021 /* 1 */ { 5,6,10,2,3,11,8,0,7,0,7,1,7,1,4,1,4,9 },
1022 /* 2 */ { 2,3,11,7,4,8,9,5,0,5,0,6,0,6,1,6,1,10 },
1023 /* 3 */ { 1,0,9,7,4,8,10,2,5,2,5,3,5,3,6,3,6,11 },
1024 /* 4 */ { 5,6,10,1,0,9,11,7,2,7,2,4,2,4,3,4,3,8 },
1025 /* 5 */ { 5,6,10,7,4,8,2,11,1,11,1,9,11,9,3,9,3,0 },
1026 /* 6 */ { 2,3,11,0,1,9,5,10,4,10,4,8,10,8,6,8,6,7 }
1027 },
1028 /*  90:    1,    3, 4,    6,     */  {
1029 /* 1 */ { 6,7,11,3,0,8,9,1,4,1,4,2,4,2,5,2,5,10 },
1030 /* 2 */ { 3,0,8,4,5,9,10,6,1,6,1,7,1,7,2,7,2,11 },
1031 /* 3 */ { 2,1,10,4,5,9,11,3,6,3,6,0,6,0,7,0,7,8 },
1032 /* 4 */ { 6,7,11,2,1,10,8,4,3,4,3,5,3,5,0,5,0,9 },
1033 /* 5 */ { 6,7,11,4,5,9,3,8,2,8,2,10,8,10,0,10,0,1 },
1034 /* 6 */ { 3,0,8,1,2,10,6,11,5,11,5,9,11,9,7,9,7,4 }
1035 } };
1036 
1037 /* 13.1 */
1038 static const char tiling13_1_[2][12] = {
1039 /* 165: 0,    2,       5,    7,  */  { 7,4,8,2,3,11,1,0,9,5,6,10 },
1040 /*  90:    1,    3, 4,    6,     */  { 6,7,11,1,2,10,0,3,8,4,5,9 }
1041 };
1042 
1043 //_____________________________________________________________________________
1044 
1045 static const char tiling14[12][12] = {
1046 /*  71: 0, 1, 2,          6,     */  { 5,  9,  8,  5,  8,  2,  5,  2,  6,  3,  2,  8 },
1047 /*  43: 0, 1,    3,    5,        */  { 2,  1,  5,  2,  5,  8,  2,  8, 11,  4,  8,  5 },
1048 /* 147: 0, 1,       4,       7,  */  { 9,  4,  6,  9,  6,  3,  9,  3,  1, 11,  3,  6 },
1049 /*  29: 0,    2, 3, 4,           */  { 1, 11, 10,  1,  4, 11,  1,  0,  4,  7, 11,  4 },
1050 /* 201: 0,       3,       6, 7,  */  { 8,  2,  0,  8,  5,  2,  8,  7,  5, 10,  2,  5 },
1051 /* 113: 0,          4, 5, 6,     */  { 0,  7,  3,  0, 10,  7,  0,  9, 10,  6,  7, 10 },
1052 /* 142:    1, 2, 3,          7,  */  { 0,  3,  7,  0,  7, 10,  0, 10,  9,  6, 10,  7 },
1053 /*  54:    1, 2,    4, 5,        */  { 8,  0,  2,  8,  2,  5,  8,  5,  7, 10,  5,  2 },
1054 /* 226:    1,          5, 6, 7,  */  { 1, 10, 11,  1, 11,  4,  1,  4,  0,  7,  4, 11 },
1055 /* 108:       2, 3,    5, 6,     */  { 9,  6,  4,  9,  3,  6,  9,  1,  3, 11,  6,  3 },
1056 /* 212:       2,    4,    6, 7,  */  { 2,  5,  1,  2,  8,  5,  2, 11,  8,  4,  5,  8 },
1057 /* 184:          3, 4, 5,    7,  */  { 5,  8,  9,  5,  2,  8,  5,  6,  2,  3,  8,  2 }
1058 };
1059 //_____________________________________________________________________________
1060 
1061 
1062 
1063 //_____________________________________________________________________________
1064 // For each of the possible vertex states listed in this table there is a
1065 // specific triangulation of the edge intersection points.  The table lists
1066 // all of them in the form of 0-5 edge triples with the list terminated by
1067 // the invalid value -1.  For example: casesClassic[3] list the 2 triangles
1068 // formed when cube[0] and cube[1] are inside of the surface, but the rest of
1069 // the cube is not.
1070 //-----------------------------------------------------------------------------
1071 static const char casesClassic[256][16] = {
1072   {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1073   { 0,  8,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1074   { 0,  1,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1075   { 1,  8,  3,  9,  8,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1076   { 1,  2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1077   { 0,  8,  3,  1,  2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1078   { 9,  2, 10,  0,  2,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1079   { 2,  8,  3,  2, 10,  8, 10,  9,  8, -1, -1, -1, -1, -1, -1, -1},
1080   { 3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1081   { 0, 11,  2,  8, 11,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1082   { 1,  9,  0,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1083   { 1, 11,  2,  1,  9, 11,  9,  8, 11, -1, -1, -1, -1, -1, -1, -1},
1084   { 3, 10,  1, 11, 10,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1085   { 0, 10,  1,  0,  8, 10,  8, 11, 10, -1, -1, -1, -1, -1, -1, -1},
1086   { 3,  9,  0,  3, 11,  9, 11, 10,  9, -1, -1, -1, -1, -1, -1, -1},
1087   { 9,  8, 10, 10,  8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1088   { 4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1089   { 4,  3,  0,  7,  3,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1090   { 0,  1,  9,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1091   { 4,  1,  9,  4,  7,  1,  7,  3,  1, -1, -1, -1, -1, -1, -1, -1},
1092   { 1,  2, 10,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1093   { 3,  4,  7,  3,  0,  4,  1,  2, 10, -1, -1, -1, -1, -1, -1, -1},
1094   { 9,  2, 10,  9,  0,  2,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1},
1095   { 2, 10,  9,  2,  9,  7,  2,  7,  3,  7,  9,  4, -1, -1, -1, -1},
1096   { 8,  4,  7,  3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1097   {11,  4,  7, 11,  2,  4,  2,  0,  4, -1, -1, -1, -1, -1, -1, -1},
1098   { 9,  0,  1,  8,  4,  7,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1},
1099   { 4,  7, 11,  9,  4, 11,  9, 11,  2,  9,  2,  1, -1, -1, -1, -1},
1100   { 3, 10,  1,  3, 11, 10,  7,  8,  4, -1, -1, -1, -1, -1, -1, -1},
1101   { 1, 11, 10,  1,  4, 11,  1,  0,  4,  7, 11,  4, -1, -1, -1, -1},
1102   { 4,  7,  8,  9,  0, 11,  9, 11, 10, 11,  0,  3, -1, -1, -1, -1},
1103   { 4,  7, 11,  4, 11,  9,  9, 11, 10, -1, -1, -1, -1, -1, -1, -1},
1104   { 9,  5,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1105   { 9,  5,  4,  0,  8,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1106   { 0,  5,  4,  1,  5,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1107   { 8,  5,  4,  8,  3,  5,  3,  1,  5, -1, -1, -1, -1, -1, -1, -1},
1108   { 1,  2, 10,  9,  5,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1109   { 3,  0,  8,  1,  2, 10,  4,  9,  5, -1, -1, -1, -1, -1, -1, -1},
1110   { 5,  2, 10,  5,  4,  2,  4,  0,  2, -1, -1, -1, -1, -1, -1, -1},
1111   { 2, 10,  5,  3,  2,  5,  3,  5,  4,  3,  4,  8, -1, -1, -1, -1},
1112   { 9,  5,  4,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1113   { 0, 11,  2,  0,  8, 11,  4,  9,  5, -1, -1, -1, -1, -1, -1, -1},
1114   { 0,  5,  4,  0,  1,  5,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1},
1115   { 2,  1,  5,  2,  5,  8,  2,  8, 11,  4,  8,  5, -1, -1, -1, -1},
1116   {10,  3, 11, 10,  1,  3,  9,  5,  4, -1, -1, -1, -1, -1, -1, -1},
1117   { 4,  9,  5,  0,  8,  1,  8, 10,  1,  8, 11, 10, -1, -1, -1, -1},
1118   { 5,  4,  0,  5,  0, 11,  5, 11, 10, 11,  0,  3, -1, -1, -1, -1},
1119   { 5,  4,  8,  5,  8, 10, 10,  8, 11, -1, -1, -1, -1, -1, -1, -1},
1120   { 9,  7,  8,  5,  7,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1121   { 9,  3,  0,  9,  5,  3,  5,  7,  3, -1, -1, -1, -1, -1, -1, -1},
1122   { 0,  7,  8,  0,  1,  7,  1,  5,  7, -1, -1, -1, -1, -1, -1, -1},
1123   { 1,  5,  3,  3,  5,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1124   { 9,  7,  8,  9,  5,  7, 10,  1,  2, -1, -1, -1, -1, -1, -1, -1},
1125   {10,  1,  2,  9,  5,  0,  5,  3,  0,  5,  7,  3, -1, -1, -1, -1},
1126   { 8,  0,  2,  8,  2,  5,  8,  5,  7, 10,  5,  2, -1, -1, -1, -1},
1127   { 2, 10,  5,  2,  5,  3,  3,  5,  7, -1, -1, -1, -1, -1, -1, -1},
1128   { 7,  9,  5,  7,  8,  9,  3, 11,  2, -1, -1, -1, -1, -1, -1, -1},
1129   { 9,  5,  7,  9,  7,  2,  9,  2,  0,  2,  7, 11, -1, -1, -1, -1},
1130   { 2,  3, 11,  0,  1,  8,  1,  7,  8,  1,  5,  7, -1, -1, -1, -1},
1131   {11,  2,  1, 11,  1,  7,  7,  1,  5, -1, -1, -1, -1, -1, -1, -1},
1132   { 9,  5,  8,  8,  5,  7, 10,  1,  3, 10,  3, 11, -1, -1, -1, -1},
1133   { 5,  7,  0,  5,  0,  9,  7, 11,  0,  1,  0, 10, 11, 10,  0, -1},
1134   {11, 10,  0, 11,  0,  3, 10,  5,  0,  8,  0,  7,  5,  7,  0, -1},
1135   {11, 10,  5,  7, 11,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1136   {10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1137   { 0,  8,  3,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1138   { 9,  0,  1,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1139   { 1,  8,  3,  1,  9,  8,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1},
1140   { 1,  6,  5,  2,  6,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1141   { 1,  6,  5,  1,  2,  6,  3,  0,  8, -1, -1, -1, -1, -1, -1, -1},
1142   { 9,  6,  5,  9,  0,  6,  0,  2,  6, -1, -1, -1, -1, -1, -1, -1},
1143   { 5,  9,  8,  5,  8,  2,  5,  2,  6,  3,  2,  8, -1, -1, -1, -1},
1144   { 2,  3, 11, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1145   {11,  0,  8, 11,  2,  0, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1},
1146   { 0,  1,  9,  2,  3, 11,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1},
1147   { 5, 10,  6,  1,  9,  2,  9, 11,  2,  9,  8, 11, -1, -1, -1, -1},
1148   { 6,  3, 11,  6,  5,  3,  5,  1,  3, -1, -1, -1, -1, -1, -1, -1},
1149   { 0,  8, 11,  0, 11,  5,  0,  5,  1,  5, 11,  6, -1, -1, -1, -1},
1150   { 3, 11,  6,  0,  3,  6,  0,  6,  5,  0,  5,  9, -1, -1, -1, -1},
1151   { 6,  5,  9,  6,  9, 11, 11,  9,  8, -1, -1, -1, -1, -1, -1, -1},
1152   { 5, 10,  6,  4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1153   { 4,  3,  0,  4,  7,  3,  6,  5, 10, -1, -1, -1, -1, -1, -1, -1},
1154   { 1,  9,  0,  5, 10,  6,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1},
1155   {10,  6,  5,  1,  9,  7,  1,  7,  3,  7,  9,  4, -1, -1, -1, -1},
1156   { 6,  1,  2,  6,  5,  1,  4,  7,  8, -1, -1, -1, -1, -1, -1, -1},
1157   { 1,  2,  5,  5,  2,  6,  3,  0,  4,  3,  4,  7, -1, -1, -1, -1},
1158   { 8,  4,  7,  9,  0,  5,  0,  6,  5,  0,  2,  6, -1, -1, -1, -1},
1159   { 7,  3,  9,  7,  9,  4,  3,  2,  9,  5,  9,  6,  2,  6,  9, -1},
1160   { 3, 11,  2,  7,  8,  4, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1},
1161   { 5, 10,  6,  4,  7,  2,  4,  2,  0,  2,  7, 11, -1, -1, -1, -1},
1162   { 0,  1,  9,  4,  7,  8,  2,  3, 11,  5, 10,  6, -1, -1, -1, -1},
1163   { 9,  2,  1,  9, 11,  2,  9,  4, 11,  7, 11,  4,  5, 10,  6, -1},
1164   { 8,  4,  7,  3, 11,  5,  3,  5,  1,  5, 11,  6, -1, -1, -1, -1},
1165   { 5,  1, 11,  5, 11,  6,  1,  0, 11,  7, 11,  4,  0,  4, 11, -1},
1166   { 0,  5,  9,  0,  6,  5,  0,  3,  6, 11,  6,  3,  8,  4,  7, -1},
1167   { 6,  5,  9,  6,  9, 11,  4,  7,  9,  7, 11,  9, -1, -1, -1, -1},
1168   {10,  4,  9,  6,  4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1169   { 4, 10,  6,  4,  9, 10,  0,  8,  3, -1, -1, -1, -1, -1, -1, -1},
1170   {10,  0,  1, 10,  6,  0,  6,  4,  0, -1, -1, -1, -1, -1, -1, -1},
1171   { 8,  3,  1,  8,  1,  6,  8,  6,  4,  6,  1, 10, -1, -1, -1, -1},
1172   { 1,  4,  9,  1,  2,  4,  2,  6,  4, -1, -1, -1, -1, -1, -1, -1},
1173   { 3,  0,  8,  1,  2,  9,  2,  4,  9,  2,  6,  4, -1, -1, -1, -1},
1174   { 0,  2,  4,  4,  2,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1175   { 8,  3,  2,  8,  2,  4,  4,  2,  6, -1, -1, -1, -1, -1, -1, -1},
1176   {10,  4,  9, 10,  6,  4, 11,  2,  3, -1, -1, -1, -1, -1, -1, -1},
1177   { 0,  8,  2,  2,  8, 11,  4,  9, 10,  4, 10,  6, -1, -1, -1, -1},
1178   { 3, 11,  2,  0,  1,  6,  0,  6,  4,  6,  1, 10, -1, -1, -1, -1},
1179   { 6,  4,  1,  6,  1, 10,  4,  8,  1,  2,  1, 11,  8, 11,  1, -1},
1180   { 9,  6,  4,  9,  3,  6,  9,  1,  3, 11,  6,  3, -1, -1, -1, -1},
1181   { 8, 11,  1,  8,  1,  0, 11,  6,  1,  9,  1,  4,  6,  4,  1, -1},
1182   { 3, 11,  6,  3,  6,  0,  0,  6,  4, -1, -1, -1, -1, -1, -1, -1},
1183   { 6,  4,  8, 11,  6,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1184   { 7, 10,  6,  7,  8, 10,  8,  9, 10, -1, -1, -1, -1, -1, -1, -1},
1185   { 0,  7,  3,  0, 10,  7,  0,  9, 10,  6,  7, 10, -1, -1, -1, -1},
1186   {10,  6,  7,  1, 10,  7,  1,  7,  8,  1,  8,  0, -1, -1, -1, -1},
1187   {10,  6,  7, 10,  7,  1,  1,  7,  3, -1, -1, -1, -1, -1, -1, -1},
1188   { 1,  2,  6,  1,  6,  8,  1,  8,  9,  8,  6,  7, -1, -1, -1, -1},
1189   { 2,  6,  9,  2,  9,  1,  6,  7,  9,  0,  9,  3,  7,  3,  9, -1},
1190   { 7,  8,  0,  7,  0,  6,  6,  0,  2, -1, -1, -1, -1, -1, -1, -1},
1191   { 7,  3,  2,  6,  7,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1192   { 2,  3, 11, 10,  6,  8, 10,  8,  9,  8,  6,  7, -1, -1, -1, -1},
1193   { 2,  0,  7,  2,  7, 11,  0,  9,  7,  6,  7, 10,  9, 10,  7, -1},
1194   { 1,  8,  0,  1,  7,  8,  1, 10,  7,  6,  7, 10,  2,  3, 11, -1},
1195   {11,  2,  1, 11,  1,  7, 10,  6,  1,  6,  7,  1, -1, -1, -1, -1},
1196   { 8,  9,  6,  8,  6,  7,  9,  1,  6, 11,  6,  3,  1,  3,  6, -1},
1197   { 0,  9,  1, 11,  6,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1198   { 7,  8,  0,  7,  0,  6,  3, 11,  0, 11,  6,  0, -1, -1, -1, -1},
1199   { 7, 11,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1200   { 7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1201   { 3,  0,  8, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1202   { 0,  1,  9, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1203   { 8,  1,  9,  8,  3,  1, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1},
1204   {10,  1,  2,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1205   { 1,  2, 10,  3,  0,  8,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1},
1206   { 2,  9,  0,  2, 10,  9,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1},
1207   { 6, 11,  7,  2, 10,  3, 10,  8,  3, 10,  9,  8, -1, -1, -1, -1},
1208   { 7,  2,  3,  6,  2,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1209   { 7,  0,  8,  7,  6,  0,  6,  2,  0, -1, -1, -1, -1, -1, -1, -1},
1210   { 2,  7,  6,  2,  3,  7,  0,  1,  9, -1, -1, -1, -1, -1, -1, -1},
1211   { 1,  6,  2,  1,  8,  6,  1,  9,  8,  8,  7,  6, -1, -1, -1, -1},
1212   {10,  7,  6, 10,  1,  7,  1,  3,  7, -1, -1, -1, -1, -1, -1, -1},
1213   {10,  7,  6,  1,  7, 10,  1,  8,  7,  1,  0,  8, -1, -1, -1, -1},
1214   { 0,  3,  7,  0,  7, 10,  0, 10,  9,  6, 10,  7, -1, -1, -1, -1},
1215   { 7,  6, 10,  7, 10,  8,  8, 10,  9, -1, -1, -1, -1, -1, -1, -1},
1216   { 6,  8,  4, 11,  8,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1217   { 3,  6, 11,  3,  0,  6,  0,  4,  6, -1, -1, -1, -1, -1, -1, -1},
1218   { 8,  6, 11,  8,  4,  6,  9,  0,  1, -1, -1, -1, -1, -1, -1, -1},
1219   { 9,  4,  6,  9,  6,  3,  9,  3,  1, 11,  3,  6, -1, -1, -1, -1},
1220   { 6,  8,  4,  6, 11,  8,  2, 10,  1, -1, -1, -1, -1, -1, -1, -1},
1221   { 1,  2, 10,  3,  0, 11,  0,  6, 11,  0,  4,  6, -1, -1, -1, -1},
1222   { 4, 11,  8,  4,  6, 11,  0,  2,  9,  2, 10,  9, -1, -1, -1, -1},
1223   {10,  9,  3, 10,  3,  2,  9,  4,  3, 11,  3,  6,  4,  6,  3, -1},
1224   { 8,  2,  3,  8,  4,  2,  4,  6,  2, -1, -1, -1, -1, -1, -1, -1},
1225   { 0,  4,  2,  4,  6,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1226   { 1,  9,  0,  2,  3,  4,  2,  4,  6,  4,  3,  8, -1, -1, -1, -1},
1227   { 1,  9,  4,  1,  4,  2,  2,  4,  6, -1, -1, -1, -1, -1, -1, -1},
1228   { 8,  1,  3,  8,  6,  1,  8,  4,  6,  6, 10,  1, -1, -1, -1, -1},
1229   {10,  1,  0, 10,  0,  6,  6,  0,  4, -1, -1, -1, -1, -1, -1, -1},
1230   { 4,  6,  3,  4,  3,  8,  6, 10,  3,  0,  3,  9, 10,  9,  3, -1},
1231   {10,  9,  4,  6, 10,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1232   { 4,  9,  5,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1233   { 0,  8,  3,  4,  9,  5, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1},
1234   { 5,  0,  1,  5,  4,  0,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1},
1235   {11,  7,  6,  8,  3,  4,  3,  5,  4,  3,  1,  5, -1, -1, -1, -1},
1236   { 9,  5,  4, 10,  1,  2,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1},
1237   { 6, 11,  7,  1,  2, 10,  0,  8,  3,  4,  9,  5, -1, -1, -1, -1},
1238   { 7,  6, 11,  5,  4, 10,  4,  2, 10,  4,  0,  2, -1, -1, -1, -1},
1239   { 3,  4,  8,  3,  5,  4,  3,  2,  5, 10,  5,  2, 11,  7,  6, -1},
1240   { 7,  2,  3,  7,  6,  2,  5,  4,  9, -1, -1, -1, -1, -1, -1, -1},
1241   { 9,  5,  4,  0,  8,  6,  0,  6,  2,  6,  8,  7, -1, -1, -1, -1},
1242   { 3,  6,  2,  3,  7,  6,  1,  5,  0,  5,  4,  0, -1, -1, -1, -1},
1243   { 6,  2,  8,  6,  8,  7,  2,  1,  8,  4,  8,  5,  1,  5,  8, -1},
1244   { 9,  5,  4, 10,  1,  6,  1,  7,  6,  1,  3,  7, -1, -1, -1, -1},
1245   { 1,  6, 10,  1,  7,  6,  1,  0,  7,  8,  7,  0,  9,  5,  4, -1},
1246   { 4,  0, 10,  4, 10,  5,  0,  3, 10,  6, 10,  7,  3,  7, 10, -1},
1247   { 7,  6, 10,  7, 10,  8,  5,  4, 10,  4,  8, 10, -1, -1, -1, -1},
1248   { 6,  9,  5,  6, 11,  9, 11,  8,  9, -1, -1, -1, -1, -1, -1, -1},
1249   { 3,  6, 11,  0,  6,  3,  0,  5,  6,  0,  9,  5, -1, -1, -1, -1},
1250   { 0, 11,  8,  0,  5, 11,  0,  1,  5,  5,  6, 11, -1, -1, -1, -1},
1251   { 6, 11,  3,  6,  3,  5,  5,  3,  1, -1, -1, -1, -1, -1, -1, -1},
1252   { 1,  2, 10,  9,  5, 11,  9, 11,  8, 11,  5,  6, -1, -1, -1, -1},
1253   { 0, 11,  3,  0,  6, 11,  0,  9,  6,  5,  6,  9,  1,  2, 10, -1},
1254   {11,  8,  5, 11,  5,  6,  8,  0,  5, 10,  5,  2,  0,  2,  5, -1},
1255   { 6, 11,  3,  6,  3,  5,  2, 10,  3, 10,  5,  3, -1, -1, -1, -1},
1256   { 5,  8,  9,  5,  2,  8,  5,  6,  2,  3,  8,  2, -1, -1, -1, -1},
1257   { 9,  5,  6,  9,  6,  0,  0,  6,  2, -1, -1, -1, -1, -1, -1, -1},
1258   { 1,  5,  8,  1,  8,  0,  5,  6,  8,  3,  8,  2,  6,  2,  8, -1},
1259   { 1,  5,  6,  2,  1,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1260   { 1,  3,  6,  1,  6, 10,  3,  8,  6,  5,  6,  9,  8,  9,  6, -1},
1261   {10,  1,  0, 10,  0,  6,  9,  5,  0,  5,  6,  0, -1, -1, -1, -1},
1262   { 0,  3,  8,  5,  6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1263   {10,  5,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1264   {11,  5, 10,  7,  5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1265   {11,  5, 10, 11,  7,  5,  8,  3,  0, -1, -1, -1, -1, -1, -1, -1},
1266   { 5, 11,  7,  5, 10, 11,  1,  9,  0, -1, -1, -1, -1, -1, -1, -1},
1267   {10,  7,  5, 10, 11,  7,  9,  8,  1,  8,  3,  1, -1, -1, -1, -1},
1268   {11,  1,  2, 11,  7,  1,  7,  5,  1, -1, -1, -1, -1, -1, -1, -1},
1269   { 0,  8,  3,  1,  2,  7,  1,  7,  5,  7,  2, 11, -1, -1, -1, -1},
1270   { 9,  7,  5,  9,  2,  7,  9,  0,  2,  2, 11,  7, -1, -1, -1, -1},
1271   { 7,  5,  2,  7,  2, 11,  5,  9,  2,  3,  2,  8,  9,  8,  2, -1},
1272   { 2,  5, 10,  2,  3,  5,  3,  7,  5, -1, -1, -1, -1, -1, -1, -1},
1273   { 8,  2,  0,  8,  5,  2,  8,  7,  5, 10,  2,  5, -1, -1, -1, -1},
1274   { 9,  0,  1,  5, 10,  3,  5,  3,  7,  3, 10,  2, -1, -1, -1, -1},
1275   { 9,  8,  2,  9,  2,  1,  8,  7,  2, 10,  2,  5,  7,  5,  2, -1},
1276   { 1,  3,  5,  3,  7,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1277   { 0,  8,  7,  0,  7,  1,  1,  7,  5, -1, -1, -1, -1, -1, -1, -1},
1278   { 9,  0,  3,  9,  3,  5,  5,  3,  7, -1, -1, -1, -1, -1, -1, -1},
1279   { 9,  8,  7,  5,  9,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1280   { 5,  8,  4,  5, 10,  8, 10, 11,  8, -1, -1, -1, -1, -1, -1, -1},
1281   { 5,  0,  4,  5, 11,  0,  5, 10, 11, 11,  3,  0, -1, -1, -1, -1},
1282   { 0,  1,  9,  8,  4, 10,  8, 10, 11, 10,  4,  5, -1, -1, -1, -1},
1283   {10, 11,  4, 10,  4,  5, 11,  3,  4,  9,  4,  1,  3,  1,  4, -1},
1284   { 2,  5,  1,  2,  8,  5,  2, 11,  8,  4,  5,  8, -1, -1, -1, -1},
1285   { 0,  4, 11,  0, 11,  3,  4,  5, 11,  2, 11,  1,  5,  1, 11, -1},
1286   { 0,  2,  5,  0,  5,  9,  2, 11,  5,  4,  5,  8, 11,  8,  5, -1},
1287   { 9,  4,  5,  2, 11,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1288   { 2,  5, 10,  3,  5,  2,  3,  4,  5,  3,  8,  4, -1, -1, -1, -1},
1289   { 5, 10,  2,  5,  2,  4,  4,  2,  0, -1, -1, -1, -1, -1, -1, -1},
1290   { 3, 10,  2,  3,  5, 10,  3,  8,  5,  4,  5,  8,  0,  1,  9, -1},
1291   { 5, 10,  2,  5,  2,  4,  1,  9,  2,  9,  4,  2, -1, -1, -1, -1},
1292   { 8,  4,  5,  8,  5,  3,  3,  5,  1, -1, -1, -1, -1, -1, -1, -1},
1293   { 0,  4,  5,  1,  0,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1294   { 8,  4,  5,  8,  5,  3,  9,  0,  5,  0,  3,  5, -1, -1, -1, -1},
1295   { 9,  4,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1296   { 4, 11,  7,  4,  9, 11,  9, 10, 11, -1, -1, -1, -1, -1, -1, -1},
1297   { 0,  8,  3,  4,  9,  7,  9, 11,  7,  9, 10, 11, -1, -1, -1, -1},
1298   { 1, 10, 11,  1, 11,  4,  1,  4,  0,  7,  4, 11, -1, -1, -1, -1},
1299   { 3,  1,  4,  3,  4,  8,  1, 10,  4,  7,  4, 11, 10, 11,  4, -1},
1300   { 4, 11,  7,  9, 11,  4,  9,  2, 11,  9,  1,  2, -1, -1, -1, -1},
1301   { 9,  7,  4,  9, 11,  7,  9,  1, 11,  2, 11,  1,  0,  8,  3, -1},
1302   {11,  7,  4, 11,  4,  2,  2,  4,  0, -1, -1, -1, -1, -1, -1, -1},
1303   {11,  7,  4, 11,  4,  2,  8,  3,  4,  3,  2,  4, -1, -1, -1, -1},
1304   { 2,  9, 10,  2,  7,  9,  2,  3,  7,  7,  4,  9, -1, -1, -1, -1},
1305   { 9, 10,  7,  9,  7,  4, 10,  2,  7,  8,  7,  0,  2,  0,  7, -1},
1306   { 3,  7, 10,  3, 10,  2,  7,  4, 10,  1, 10,  0,  4,  0, 10, -1},
1307   { 1, 10,  2,  8,  7,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1308   { 4,  9,  1,  4,  1,  7,  7,  1,  3, -1, -1, -1, -1, -1, -1, -1},
1309   { 4,  9,  1,  4,  1,  7,  0,  8,  1,  8,  7,  1, -1, -1, -1, -1},
1310   { 4,  0,  3,  7,  4,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1311   { 4,  8,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1312   { 9, 10,  8, 10, 11,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1313   { 3,  0,  9,  3,  9, 11, 11,  9, 10, -1, -1, -1, -1, -1, -1, -1},
1314   { 0,  1, 10,  0, 10,  8,  8, 10, 11, -1, -1, -1, -1, -1, -1, -1},
1315   { 3,  1, 10, 11,  3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1316   { 1,  2, 11,  1, 11,  9,  9, 11,  8, -1, -1, -1, -1, -1, -1, -1},
1317   { 3,  0,  9,  3,  9, 11,  1,  2,  9,  2, 11,  9, -1, -1, -1, -1},
1318   { 0,  2, 11,  8,  0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1319   { 3,  2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1320   { 2,  3,  8,  2,  8, 10, 10,  8,  9, -1, -1, -1, -1, -1, -1, -1},
1321   { 9, 10,  2,  0,  9,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1322   { 2,  3,  8,  2,  8, 10,  0,  1,  8,  1, 10,  8, -1, -1, -1, -1},
1323   { 1, 10,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1324   { 1,  3,  8,  9,  1,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1325   { 0,  9,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1326   { 0,  3,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
1327   {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
1328 };
1329 
1330 #endif // _LOOKUPTABLE_H_
1331 
1332