#!/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()