From d77258a0996f62303871d19bfe90952692f51df6 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Thu, 28 Jan 2021 18:18:11 +0100 Subject: [PATCH] Better Emergo pieces --- .../pieces/Emergo/generateSVG_composite.py | 80 +++++++++---------- .../pieces/Emergo/generateSVG_simple.py | 4 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/client/public/images/pieces/Emergo/generateSVG_composite.py b/client/public/images/pieces/Emergo/generateSVG_composite.py index aaae1898..1e37f2b6 100755 --- a/client/public/images/pieces/Emergo/generateSVG_composite.py +++ b/client/public/images/pieces/Emergo/generateSVG_composite.py @@ -10,87 +10,87 @@ preamble = """<?xml version="1.0" encoding="UTF-8" ?> <defs> <mask id="stripe"> <rect x="0" y="0" width="230" height="230" fill="white"/> - <rect x="130" y="0" width="90" height="230"/> + <rect x="0" y="115" width="230" height="115"/> </mask> </defs>""" -black_left = '<circle cx="115" cy="115" r="100" fill="black" stroke="orange" mask="url(#stripe)"/>' -white_right = '<circle cx="115" cy="115" r="100" fill="whitesmoke"/>' -white_left = '<circle cx="115" cy="115" r="100" fill="whitesmoke" stroke="orange" mask="url(#stripe)"/>' -black_right = '<circle cx="115" cy="115" r="100" fill="black"/>' +black_top = '<circle cx="115" cy="115" r="100" fill="black" mask="url(#stripe)"/>' +white_bottom = '<circle cx="115" cy="115" r="100" fill="whitesmoke" stroke="saddlebrown"/>' +white_top = '<circle cx="115" cy="115" r="100" fill="whitesmoke" stroke="saddlebrown" mask="url(#stripe)"/>' +black_bottom = '<circle cx="115" cy="115" r="100" fill="black"/>' digits = { - "left": [ + "top": [ # 1 - '<path d="M95,85 v60"', + '<path d="M130,35 v60"', # 2 - '<path d="M65,85 h30 v30 h-30 v30 h30"', + '<path d="M100,35 h30 v30 h-30 v30 h30"', # 3 - '<path d="M65,85 h30 v30 h-30 M95,115 v30 h-30"', + '<path d="M100,35 h30 v30 h-30 M130,65 v30 h-30"', # 4 - '<path d="M65,85 v30 h30 v30 M95,95 v30"', + '<path d="M100,35 v30 h30 v30 M130,35 v30"', # 5 - '<path d="M95,85 h-30 v30 h30 v30 h-30"', + '<path d="M130,35 h-30 v30 h30 v30 h-30"', # 6 - '<path d="M95,85 h-30 v60 h30 v-30 h-30"', + '<path d="M130,35 h-30 v60 h30 v-30 h-30"', # 7 - '<path d="M65,85 h30 v60"', + '<path d="M100,35 h30 v60"', # 8 - '<path d="M65,85 h30 v60 h-30 z M65,115 h30"', + '<path d="M100,35 h30 v60 h-30 z M100,65 h30"', # 9 - '<path d="M65,145 h30 v-60 h-30 v30 h30"', + '<path d="M100,95 h30 v-60 h-30 v30 h30"', # 10 - '<path d="M55,85 v60 M65,85 h30 v60 h-30 v-60"', + '<path d="M90,35 v60 M100,35 h30 v60 h-30 v-60"', # 11 - '<path d="M55,85 v60 M95,85 v60"', + '<path d="M90,35 v60 M130,35 v60"', # 12 - '<path d="M55,85 v60 M65,85 h30 v30 h-30 v30 h30"' + '<path d="M90,35 v60 M100,35 h30 v30 h-30 v30 h30"' ], - "right": [ + "bottom": [ # 1 - '<path d="M185,85 v60"', + '<path d="M130,135 v60"', # 2 - '<path d="M155,85 h30 v30 h-30 v30 h30"', + '<path d="M100,135 h30 v30 h-30 v30 h30"', # 3 - '<path d="M155,85 h30 v30 h-30 M185,115 v30 h-30"', + '<path d="M100,135 h30 v30 h-30 M130,165 v30 h-30"', # 4 - '<path d="M155,85 v30 h30 v30 M185,85 v30"', + '<path d="M100,135 v30 h30 v30 M130,135 v30"', # 5 - '<path d="M185,85 h-30 v30 h30 v30 h-30"', + '<path d="M130,135 h-30 v30 h30 v30 h-30"', # 6 - '<path d="M185,85 h-30 v60 h30 v-30 h-30"', + '<path d="M130,135 h-30 v60 h30 v-30 h-30"', # 7 - '<path d="M155,85 h30 v60"', + '<path d="M100,135 h30 v60"', # 8 - '<path d="M155,85 h30 v60 h-30 z M155,115 h30"', + '<path d="M100,135 h30 v60 h-30 z M100,165 h30"', # 9 - '<path d="M155,145 h30 v-60 h-30 v30 h30"', + '<path d="M100,195 h30 v-60 h-30 v30 h30"', # 10 - '<path d="M145,85 v60 M155,85 h30 v60 h-30 v-60"', + '<path d="M90,135 v60 M100,135 h30 v60 h-30 v-60"', # 11 - '<path d="M145,85 v60 M185,85 v60"', + '<path d="M90,135 v60 M130,135 v60"', # 12 - '<path d="M145,85 v60 M155,85 h30 v30 h-30 v30 h30"' + '<path d="M90,135 v60 M100,135 h30 v30 h-30 v30 h30"' ] } final = "</svg>" -for colorLeft in ["white", "black"]: - chrShift = 0 if colorLeft == "white" else 32 - for left in range(12): - for right in range(12): - filename = chr(65 + left + chrShift) + chr(65 + right + chrShift) + ".svg" +for colorTop in ["white", "black"]: + chrShift = 0 if colorTop == "white" else 32 + for top in range(12): + for bottom in range(12): + filename = chr(65 + top + chrShift) + chr(65 + bottom + chrShift) + ".svg" f = open(filename, "w") f.write(preamble) f.write("\n") - f.write(black_right if colorLeft == "white" else white_right) + f.write(black_bottom if colorTop == "white" else white_bottom) f.write("\n") - f.write(white_left if colorLeft == "white" else black_left) + f.write(white_top if colorTop == "white" else black_top) f.write("\n") - f.write(digits["left"][left] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorLeft == "white" else 'stroke="orange"') + '/>') + f.write(digits["top"][top] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorTop == "white" else 'stroke="orange"') + '/>') f.write("\n") - f.write(digits["right"][right] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorLeft == "black" else 'stroke="orange"') + '/>') + f.write(digits["bottom"][bottom] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorTop == "black" else 'stroke="orange"') + '/>') f.write("\n") f.write(final) f.close() diff --git a/client/public/images/pieces/Emergo/generateSVG_simple.py b/client/public/images/pieces/Emergo/generateSVG_simple.py index 301c2796..fd397af2 100755 --- a/client/public/images/pieces/Emergo/generateSVG_simple.py +++ b/client/public/images/pieces/Emergo/generateSVG_simple.py @@ -8,8 +8,8 @@ preamble = """<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="230" height="230">""" -black = '<circle cx="115" cy="115" r="100" fill="black" stroke="orange"/>' -white = '<circle cx="115" cy="115" r="100" fill="whitesmoke" stroke="orange"/>' +black = '<circle cx="115" cy="115" r="100" fill="black"/>' +white = '<circle cx="115" cy="115" r="100" fill="whitesmoke" stroke="saddlebrown"/>' digits = [ # 1 -- 2.44.0