From: Benjamin Auder Date: Wed, 13 May 2026 12:49:35 +0000 (+0200) Subject: update X-Git-Url: https://git.auder.net/images/doc/assets/app_dev.php/scripts/%7B%7B%20pkg.url%20%7D%7D?a=commitdiff_plain;h=ab84e7d192fb684316dff689e9ce75a937143dd4;p=xogo.git update --- diff --git a/initialize.sh b/initialize.sh index 9e187d0..a7fd40d 100755 --- a/initialize.sh +++ b/initialize.sh @@ -5,4 +5,4 @@ wget https://xogo.casa/extras.zip && unzip extras.zip cp js/parameters.js.dist js/parameters.js npm i cd pieces/Avalam && python generateSVG.py && cd ../.. -#cd pieces/Emergo && python generateSVG.py && cd ../.. +cd pieces/Emergo && python generateSVG.py && cd ../.. diff --git a/pieces/Emergo/generateSVG_composite.py b/pieces/Emergo/generateSVG_composite.py new file mode 100755 index 0000000..85726d5 --- /dev/null +++ b/pieces/Emergo/generateSVG_composite.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +# Compose each piece SVG with numbers +# https://travishorn.com/removing-parts-of-shapes-in-svg-b539a89e5649 +# https://developer.mozilla.org/fr/docs/Web/SVG/Tutoriel/Paths + +preamble = """ + + + + + + + +""" + +black_top = '' +white_bottom = '' +white_top = '' +black_bottom = '' + +digits = { + "top": [ + # 1 (unused here) + '= 1: + f.write(digits["top"][top] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorTop == "white" else 'stroke="orange"') + '/>') + f.write("\n") + if bottom >= 1: + 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/pieces/Emergo/generateSVG_simple.py b/pieces/Emergo/generateSVG_simple.py new file mode 100755 index 0000000..51f734e --- /dev/null +++ b/pieces/Emergo/generateSVG_simple.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python + +# Compose each piece SVG with numbers +# https://travishorn.com/removing-parts-of-shapes-in-svg-b539a89e5649 +# https://developer.mozilla.org/fr/docs/Web/SVG/Tutoriel/Paths + +preamble = """ + +""" + +black = '' +white = '' + +digits = [ + # 1 (unused) + '= 1: + f.write(digits[number] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if color == "white" else 'stroke="orange"') + '/>') + f.write("\n") + f.write(final) + f.close() + + +preamble = """ + + + + + + + +""" + +black_top = '' +white_bottom = '' +white_top = '' +black_bottom = '' + +digits = { + "top": [ + # 1 (unused here) + '= 1: + f.write(digits["top"][top] + ' fill="none" stroke-width="5" ' + ('stroke="red"' if colorTop == "white" else 'stroke="orange"') + '/>') + f.write("\n") + if bottom >= 1: + 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()