From c90b8bb787aa143d29e4f6cb9dd1315090801e1e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 4 Mar 2019 01:25:27 +0000 Subject: [PATCH] max and minprintable --- .gitignore | 3 ++- Makefile | 13 ++++++++----- generate-board | 21 +++++++++++++-------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 7b6b82e..895aae5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ opt.plag faces.plag .opt.plag.sums *.tmp -whole.ps +maxprintable.ps +minprintable.ps layout-test.ps layout-test-?.ps a4-test-?.ps diff --git a/Makefile b/Makefile index fef7280..d9e0cc9 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ USE_PLAG_RELEASE := $(shell ./find-plag \ default: all -all: whole.ps layout-test.ps \ +all: maxprintable.ps minprintable.ps layout-test.ps \ $(addprefix a4-test-,$(addsuffix .ps, b m t)) \ $(addprefix layout-test-,$(addsuffix .ps, b m t)) @@ -38,16 +38,19 @@ opt.plag: maybe-rerun-optim map.plag $(USE_PLAG_RELEASE) Makefile faces.plag: opt.plag $(USE_PLAG_DEBUG) Makefile $(USE_PLAG_DEBUG) RF $< W-FACES $@.tmp && $i -whole.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm - ./generate-board -XS faces.plag input-graph $o +maxprintable.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm + ./generate-board faces.plag input-graph $o -layout-test.ps: whole.ps Makefile Parse.pm +minprintable.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm + ./generate-board -XM faces.plag input-graph $o + +layout-test.ps: maxprintable.ps Makefile Parse.pm ./generate-board -XW faces.plag input-graph $o layout-test-%.ps: layout-test-prefix-%.ps layout-test.ps cat $^ $o -a4-test-%.ps: layout-test-prefix-%.ps whole.ps +a4-test-%.ps: layout-test-prefix-%.ps maxprintable.ps cat $^ $o #map.ps: map.dot diff --git a/generate-board b/generate-board index a6d00c5..b2f8e81 100755 --- a/generate-board +++ b/generate-board @@ -16,7 +16,7 @@ BEGIN { unshift @INC, qw(.); } use Parse; -our $xopts; +our $xopts = ''; our $facesf; our %vxname2pos; # $vxname2pos{VXNAME} = Math::GSL::Vector @@ -25,6 +25,13 @@ sub MM2PT { 72.0 / 25.4; } our $mid; +our $a4_w = 595; +our $a4_h = 842; +our $a3_h = 1190; + +our $max_printeredge = 5.50; + + # ----- region names from plag, incl. reverse mapping ----- our %prs2region; @@ -306,12 +313,12 @@ sub pscolour ($;$) { } sub preamble() { - my $printeredge = 5 * MM2PT; - my $xsz = 842; - my $ysz = 3 * 595 - 4 * $printeredge; + my $tprinteredge = ($xopts =~ m/M/ ? $max_printeredge : 0) * MM2PT; + my $xmax = $a4_h - $tprinteredge; + my $ymax = ($a4_w + $a3_h) - 2 * $max_printeredge - $tprinteredge; o(<