def explore_rotations(tile, poly,polyname): if DEBUG1 or DEBUG2 or DEBUG3 or 1: Draw.initialise_drawing(WIDTH, HEIGHT) if DEBUG1 or DEBUG2 or DEBUG3: Draw.empty_shapes() # Draw.polygon_shape((Point(0,0),Point(150,0),Point(150,150)), (255,0,0), alpha=1, outline=1) startcase = 0 startface = 0 face_ori = 0 case_ori = 0 # extend_tile(Point(300,300),Point(300,310),0,tile[0][0],tile) neighbour_coord = create_neighbour_coordinates(tile) dim = len(tuple(neighbour_coord.values())[0][0]) if DEBUG2: print("-" * 20) if DEBUG2: print("Coordinate infos:", neighbour_coord) if DEBUG2: print("Number of axes:", dim) for coord in sorted(neighbour_coord): if DEBUG2: print(coord, ":", neighbour_coord[coord]) # print("Dimensions:",dim) # print(flush=True) positions = dict() symmetry_axis = list() for case in tile: for face in poly: for orientation in range(len(poly[face])): positions[(case, face, orientation)] = list() if DEBUG3: print("Possible combinations: %d" % len(positions)) pos = (P1, P2, 0, 0, 0, [0 for x in range(dim)], 1) to_explore = [pos] while to_explore: p1, p2, case, face, orientation, tilecoord, tilecoordsign = to_explore.pop() # if(case%len(tile)!=case): # continue # print("exploring",p1,p2,"case",case,"face",face,orientation,tilecoord, tilecoordsign ) if len(tile[case % len(tile)]) != len(poly[face]): continue # caseorientation = 0 # orientation is tileorientation # print("Known positions for",case%len(tile),face,orientation) # print(positions[(case%len(tile),face,orientation)]) if tilecoord in positions[(case % len(tile), face, orientation)]: continue
net = platonics[tilename] tilename = "platonics_" + tilename print("]" * 50 + tilename) Draw.text_topleftalign(tilename, 2, 2, (0, 0, 0), 30) shape = net order = sorted(net.keys()) visualise(p1, p2, 0, net[0][0], 2) fill_screen(p1, p2, order[0], color=None) Draw.text_topleftalign(tilename, 2, 2, (255, 0, 0), 30, bgcolor=(255, 255, 255)) Draw.refresh() try:os.mkdir("platonic_tilings_images") except:pass Draw.save_screen("platonic_tilings_images/" + tilename + ".png") # Draw.wait_for_input() Draw.empty_shapes() isogonals['3.4^2.6;3.6.3.6)_2'] = \ {0: [2, 8, 1, 13], 1: [False, 29, 17, 3, 22, 34], 2: [False, 16, 21], 3: [1, 10, 4, 5], 4: [3, 31, 26]} for tilename in isogonals: net = isogonals[tilename] tilename = "isogonal_" + tilename print("]" * 50 + tilename) Draw.text_topleftalign(tilename, 2, 2, (0, 0, 0), 30) shape = net order = sorted(net.keys()) visualise(p1, p2, 0, net[0][0], 2)