-
Notifications
You must be signed in to change notification settings - Fork 0
/
regen-segs.py
85 lines (83 loc) · 3.06 KB
/
regen-segs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
panels = [
("side 11", True, [
[ 8, 10, 18, 37, 50, 59, 68, 70, 72, 74,],
[ 45, 46, 47, 39, 31, 23, 15, 7,],
[ 37, 38, 30, 22, 14, 6, 5, 4, 3, 2, 1, 9, 17, 25, 33, 41, 49, 50, 58,],
[ 29, 21, 13, 12, 11, 10, 18, 26, 34, 42, 43, 51, 59,],
[ 28, 20, 19, 27, 35, 36, 44, 52, 60,],
[ 0, 8, 16, 24, 32, 40, 48, 56, 57,],
[ 55, 63,],
[ 54, 62,],
[ 53, 61,],
]),
("side 14", False, [
[ 7, 9, 16, 24, 31, 44, 54, 67, 73,],
[ 2, 1, 0, 8, 16, 17, 18,],
[ 9, 10, 11, 3, 4, 12, 13, 14,],
[ 5, 6, 7, 15, 23, 22, 21,],
[24, 25, 33, 32, 40, 41, 42, 50, 49, 48, 56, 57, 58,],
[35, 34, 26, 27, 19, 20, 28, 29, 37, 36,],
[31, 30, 38, 39, 47, 46, 45, 53, 54, 55, 63, 62, 61,],
[59, 51, 43, 44, 52, 60,],
]),
("side 06", False, [
[ 9, 11, 26, 32, 39, 45, 51, 57, 63, 71, 75,],
[ 0, 8, 16, 24, 32, 33, 25, 26, 27, 19, 20, 21, 13, 14, 15,],
[ 1, 9, 17, 18, 10, 2,],
[ 3, 11, 12, 4, 5, 6, 7,],
[ 56, 48, 40, 41, 49, 57,],
[ 50, 42, 34, 35, 43, 51,],
[ 44, 36, 28, 29, 37, 45,],
[ 38, 30, 22, 23, 31, 39,],
[ 58, 59, 60, 52, 53, 54, 46, 47,],
[ 61, 62, 63, 55,],
]),
("side 13", False, [
[ 8, 10, 17, 21, 25, 43, 47, 51, 58, 74,],
[ 0, 1, 2, 10, 9, 8, 16,],
[ 17, 25, 26, 18,],
[ 33, 41, 42, 34,],
[ 49, 50, 51, 43, 35, 27, 19, 11, 3, 4, 12, 20, 28, 36, 44, 52, 53, 54,],
[ 37, 45, 46, 38,],
[ 21, 29, 30, 22,],
[ 7, 6, 5, 13, 14, 15, 23,],
[ 31, 39, 47, 55, 63, 62, 61, 60, 59, 58, 57, 56, 48, 40, 32, 24,],
]),
("side 08", True, [
[ 6, 8, 16, 31, 38, 53, 61, 68,],
[ 17, 16, 8, 9, 1, 2, 10, 18,],
[ 42, 34, 33, 32, 24, 25, 26, 27, 19, 11, 3, 4, 12, 20, 28,],
[ 13, 5, 6, 14, 15, 23, 22,],
[ 21, 29, 30, 31, 39, 38, 37, 36, 44, 52, 60, 59, 51, 43, 35,],
[ 45, 53, 61, 62, 54, 55, 47, 46,],
[ 41, 40, 48, 49, 57, 58, 50,],
]),
("side 04", False, [
[ 7, 9, 27, 35, 47, 53, 61, 65, 73,],
[ 40, 32, 24, 16, 8, 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31, 39, 47,],
[ 57, 56, 48, 49, 41, 33, 25, 17,],
[ 9, 10, 18, 26, 34, 35, 36, 37, 29, 21, 13, 14,],
[ 11, 19, 27, 28, 20, 12,],
[ 58, 50, 42, 43, 44, 45, 53, 61,],
[ 59, 51, 52, 60,],
[ 62, 63, 55, 54, 46, 38, 30, 22,],
])
]
for name, flip, panel in panels:
count = 0
count += len(panel[0])
print ', '.join(str(i) for i in panel[0]) + ', '
for seg in panel[1:]:
count += len(seg)
out = []
for pixel in seg:
row = pixel / 8
col = pixel % 8
if flip:
row = 8 - (row+1)
col = 8 - (col+1)
out.append((row, col))
print out
rest = ['-1'] * (75 - count)
print ', '.join(rest)
print '},'