chiark / gitweb /
quacks-ingredients: ad hoc print jobs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Mar 2020 15:10:26 +0000 (15:10 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Mar 2020 15:10:26 +0000 (15:10 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
quacks-ingredients-counts
quacks-ingredients-counts.scad

index 7d4d8d863540c672f7bfb4400cef72000e397de4..101629598d265555c2e578f3344c11061ccf72c9 100755 (executable)
@@ -5,13 +5,30 @@ use strict;
 use Data::Dumper;
 use POSIX;
 
+sub xdata ($) {
+    my ($cb) = @_;
+    foreach my $count (qw(1 2 3)) {
+       foreach my $nspots (qw(1 2 3 4)) {
+           $_ = $cb->($count,$nspots)."\t".$_;
+       }
+    }
+}
+
 $_=<DATA>; chomp or die;
+xdata sub {
+    my ($xcount,$xnspots) = @_;
+    "${xcount}x". (qw(X One Two Three Four)[$xnspots]);
+};
 our @names = split /\t/, $_;
 
 our %count;
 
 foreach my $nspots (qw(1 2 3 4)) {
     $_=<DATA>; chomp or die;
+    xdata sub {
+       my ($xcount,$xnspots) = @_;
+       $xnspots == $nspots and $xcount;
+    };
     my @l = split /\t/, $_;
     foreach my $i (0..$#names) { $count{$names[$i]}{$nspots} = $l[$i] || 0; }
 }
index 80eec2fd10e1007c88758fa26a379678d5030d6d..27fbfec1cb4793a346f8b70c5992d6f43b0cc825 100644 (file)
@@ -1,6 +1,258 @@
 // autogenerated - do not edit
 //  update script is quacks-ingredients-updates-levels
 //  source is quacks-ingredients-counts
+module 1xFour(){ ////toplevel
+// total=1, rowsz=1, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+    translate(token_pitch * [   0.0,   0.0 ]) Token_L();
+  };
+}
+module 1xOne(){ ////toplevel
+// total=1, rowsz=1, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+    translate(token_pitch * [   0.0,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 1xThree(){ ////toplevel
+// total=1, rowsz=1, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+    translate(token_pitch * [   0.0,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 1xTwo(){ ////toplevel
+// total=1, rowsz=1, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+    translate(token_pitch * [   0.0,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 2xFour(){ ////toplevel
+// total=2, rowsz=2, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+    translate(token_pitch * [  -0.5,   0.0 ]) Token_L();
+    translate(token_pitch * [   0.5,   0.0 ]) Token_L();
+  };
+}
+module 2xOne(){ ////toplevel
+// total=2, rowsz=2, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+    translate(token_pitch * [  -0.5,   0.0 ]) Token_L();
+    translate(token_pitch * [   0.5,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 2xThree(){ ////toplevel
+// total=2, rowsz=2, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+    translate(token_pitch * [  -0.5,   0.0 ]) Token_L();
+    translate(token_pitch * [   0.5,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 2xTwo(){ ////toplevel
+// total=2, rowsz=2, nrows=1
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 2;
+    translate(token_pitch * [  -0.5,   0.0 ]) Token_L();
+    translate(token_pitch * [   0.5,   0.0 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 3xFour(){ ////toplevel
+// total=3, rowsz=2, nrows=2
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 4;
+    translate(token_pitch * [  -0.5,  -0.5 ]) Token_L();
+    translate(token_pitch * [  -0.5,   0.5 ]) Token_L();
+    translate(token_pitch * [   0.5,  -0.5 ]) Token_L();
+  };
+}
+module 3xOne(){ ////toplevel
+// total=3, rowsz=2, nrows=2
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 1;
+    translate(token_pitch * [  -0.5,  -0.5 ]) Token_L();
+    translate(token_pitch * [  -0.5,   0.5 ]) Token_L();
+    translate(token_pitch * [   0.5,  -0.5 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 3xThree(){ ////toplevel
+// total=3, rowsz=2, nrows=2
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 2;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 3;
+    translate(token_pitch * [  -0.5,  -0.5 ]) Token_L();
+    translate(token_pitch * [  -0.5,   0.5 ]) Token_L();
+    translate(token_pitch * [   0.5,  -0.5 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 4;
+  };
+}
+module 3xTwo(){ ////toplevel
+// total=3, rowsz=2, nrows=2
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 1;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 2;
+    translate(token_pitch * [  -0.5,  -0.5 ]) Token_L();
+    translate(token_pitch * [  -0.5,   0.5 ]) Token_L();
+    translate(token_pitch * [   0.5,  -0.5 ]) Token_L();
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 3;
+  };
+  union(){
+    Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]);
+    $nspots = 4;
+  };
+}
 module Black(){ ////toplevel
 // total=18, rowsz=5, nrows=4
   union(){
@@ -369,5 +621,5 @@ module Yellow(){ ////toplevel
     translate(token_pitch * [   2.5,   1.0 ]) Token_L();
   };
 }
-// total_count=216
+// total_count=240
 // max_rowsz=7 max_nrows=6