From c853a09d5d478ff0d0a311dddfaa0a960d973ce9 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 13 Aug 2010 22:30:13 -0300 Subject: [PATCH] Print 16 covers on a page. - cvr.py (main): moved previous main code to a function - cvr.py: generate cover repeatedly and distribute it on the page --- cvr.py | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/cvr.py b/cvr.py index 8f7d18c..676b5b1 100755 --- a/cvr.py +++ b/cvr.py @@ -159,26 +159,41 @@ def rect_outline(x0, y0, z0, x1, y1, z1): # ----- Main ------------------------------------------------------------------ -if __name__ == "__main__": - do = outline_gnuplot - sk = None -else: - import HeeksPython as cad +def main(): + global do - do = outline_cad - cad.sketch() - sk = cad.getlastobj() + if __name__ == "__main__": + do = outline_gnuplot + sk = None + else: + import HeeksPython as cad + + do = outline_cad + cad.sketch() + sk = cad.getlastobj() -outline(sk) -label(sk) + outline(sk) + label(sk) + + shape.rect = rect_outline + shape.make_base() + + if __name__ == "__main__": + for e in lines: + gnuplot_line(*e) + else: + for e in lines: + cad_line(sk, *e) + cad.translate(sk, -13, -44, 0) + + return sk -shape.rect = rect_outline -shape.make_base() if __name__ == "__main__": - for e in lines: - gnuplot_line(*e) + main() else: - for e in lines: - cad_line(sk, *e) + for x in (-100, 0): + for y in range(0, 256, 32): + sk = main() + cad.translate(sk, x, y-150, 0)