-
Notifications
You must be signed in to change notification settings - Fork 2
/
redblue.py
121 lines (116 loc) · 2.75 KB
/
redblue.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
from wfc import WaveFunctionCollapse
CONFIG = {
"clean_edges": False,
"overlapping": False,
"color_divider": 1,
"tiles": [
{
"filename": "./tiles/redblue/wfc-2c-1.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/redblue/wfc-2c-2.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
# {
# "filename": "./tiles/redblue/wfc-2c-3.png",
# "rotate90": False,
# "rotate180": False,
# "rotate270": False,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
{
"filename": "./tiles/redblue/wfc-2c-4.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/redblue/wfc-2c-5.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/redblue/wfc-2c-6.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
# {
# "filename": "./tiles/redblue/wfc-2c-7.png",
# "rotate90": True,
# "rotate180": True,
# "rotate270": True,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
# {
# "filename": "./tiles/redblue/wfc-2c-8.png",
# "rotate90": True,
# "rotate180": True,
# "rotate270": True,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
# {
# "filename": "./tiles/redblue/wfc-2c-9.png",
# "rotate90": True,
# "rotate180": True,
# "rotate270": True,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
# {
# "filename": "./tiles/redblue/wfc-2c-10.png",
# "rotate90": False,
# "rotate180": False,
# "rotate270": False,
# "flip_vertical": True,
# "flip_horizontal": True,
# },
# {
# "filename": "./tiles/redblue/wfc-2c-11.png",
# "rotate90": True,
# "rotate180": True,
# "rotate270": True,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
# {
# "filename": "./tiles/redblue/wfc-2c-12.png",
# "rotate90": True,
# "rotate180": True,
# "rotate270": True,
# "flip_vertical": False,
# "flip_horizontal": False,
# },
]
}
OUTPUT_FILE = "redblue.png"
TILESHEET_FILE = "redblue-tilesheet.png"
X_TILES = 50
Y_TILES = 50
def main():
wfc = WaveFunctionCollapse(silent = False)
wfc.load_config(CONFIG)
wfc.create_tilesheet(TILESHEET_FILE)
wfc.collapse(X_TILES, Y_TILES)
wfc.save(OUTPUT_FILE)
if __name__ == "__main__":
main()