From f51efdc7db671e60fe42def7eb43cda2f739d79d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 28 Mar 2020 15:10:26 +0000 Subject: [PATCH] quacks-ingredients: ad hoc print jobs Signed-off-by: Ian Jackson --- quacks-ingredients-counts | 17 +++ quacks-ingredients-counts.scad | 254 ++++++++++++++++++++++++++++++++- 2 files changed, 270 insertions(+), 1 deletion(-) diff --git a/quacks-ingredients-counts b/quacks-ingredients-counts index 7d4d8d8..1016295 100755 --- a/quacks-ingredients-counts +++ b/quacks-ingredients-counts @@ -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".$_; + } + } +} + $_=; 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)) { $_=; 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; } } diff --git a/quacks-ingredients-counts.scad b/quacks-ingredients-counts.scad index 80eec2f..27fbfec 100644 --- a/quacks-ingredients-counts.scad +++ b/quacks-ingredients-counts.scad @@ -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 -- 2.30.2