From 29affe09b459127422544474986a69d83b2fe5ac Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Mon, 21 Oct 2024 16:09:57 -0400 Subject: Data package. --- tools/genlayout.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tools/genlayout.py (limited to 'tools/genlayout.py') diff --git a/tools/genlayout.py b/tools/genlayout.py new file mode 100644 index 0000000..54b1724 --- /dev/null +++ b/tools/genlayout.py @@ -0,0 +1,51 @@ +list = [] + +def flush(): + global mode, name, x, y, w, h + if mode == 'rect': + list.append((name, round(x+w/2), round(y+h/2))) + if mode == 'circle': + list.append((name, round(x), round(y))) + mode = None + +def readsvg(filename): + global mode, name, x, y, w, h + mode = None + name = None + x = y = w = h = 0 + for line in open(filename).readlines(): + line = line.strip() + if line == "