From cc0345f766e2118421cad98daea91b087ab73dd6 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 12 Dec 2016 01:00:43 +0100 Subject: ChipDesign: Add text labels with size and number --- chip_design/solution-to-latex.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chip_design') diff --git a/chip_design/solution-to-latex.py b/chip_design/solution-to-latex.py index 2028b1b..798267a 100755 --- a/chip_design/solution-to-latex.py +++ b/chip_design/solution-to-latex.py @@ -80,6 +80,12 @@ def print_boxes(): tpl = r"\draw[{attrs}] ({x}, {y}) rectangle ({x2}, {y2});" print(tpl.strip().format(**vars())) + # Draw number for debugging + tx = x + w/2 + ty = y + h/2 + text = r"%s\\(%s x %s)" % (i, w, h) + print(r'\node[align=center] at (%f,%f) {%s};' % (tx, ty, text)) + def print_grid(): # XXX currently hard-coding grid size print(r'\draw[step=1,gray,very thin] (0, 0) grid (30, 30);') -- cgit v1.2.1