-
Notifications
You must be signed in to change notification settings - Fork 2
/
circuit.py
129 lines (124 loc) · 2.83 KB
/
circuit.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
122
123
124
125
126
127
128
129
from wfc import WaveFunctionCollapse
CONFIG = {
"clean_edges": False,
"overlapping": False,
"color_divider": 1,
"tiles": [
{
"filename": "./tiles/circuit/circuit-1.png",
"rotate90": False,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-2.png",
"rotate90": False,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-3.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-4.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-5.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-6.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-7.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-8.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-9.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-10.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-11.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-12.png",
"rotate90": True,
"rotate180": True,
"rotate270": True,
"flip_vertical": False,
"flip_horizontal": False,
},
{
"filename": "./tiles/circuit/circuit-13.png",
"rotate90": True,
"rotate180": False,
"rotate270": False,
"flip_vertical": False,
"flip_horizontal": False,
},
]
}
OUTPUT_FILE = "circuit.png"
TILESHEET_FILE = "circuit-tilesheet.png"
X_TILES = 30
Y_TILES = 20
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()