From d37bf8375b0efdc271e01eb9cfa22defbded385d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 31 Mar 2020 16:16:02 +0100 Subject: [PATCH] quacks-ingredients: -counts: Have zero-spots counters too Signed-off-by: Ian Jackson --- quacks-ingredients-counts | 3 +- quacks-ingredients-counts.scad | 152 +++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/quacks-ingredients-counts b/quacks-ingredients-counts index 5c20fc8..6fb5a04 100755 --- a/quacks-ingredients-counts +++ b/quacks-ingredients-counts @@ -26,7 +26,7 @@ our @names = split /\t/, $_; our %count; -foreach my $nspots (qw(1 2 3 4)) { +foreach my $nspots (qw(1 2 3 4 0)) { $_=; chomp or die; xdata sub { my ($xcount,$xnspots) = @_; @@ -108,3 +108,4 @@ White Green Blue Red Yellow Purple Black Orange WhiteSpare 8+3 10+5 10+5 8+5 6+5 1+0 4+2 1+0 13+5 10+5 10+5 10+5 + diff --git a/quacks-ingredients-counts.scad b/quacks-ingredients-counts.scad index 60c3878..6b4c507 100644 --- a/quacks-ingredients-counts.scad +++ b/quacks-ingredients-counts.scad @@ -3,6 +3,10 @@ // source is quacks-ingredients-counts module Base_1xFour(){ ////toplevel // Base 1xFour total= 1 rowsz=1 nrows=1 + union(){ + Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -23,6 +27,10 @@ module Base_1xFour(){ ////toplevel } module Base_1xOne(){ ////toplevel // Base 1xOne total= 1 rowsz=1 nrows=1 + union(){ + Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -43,6 +51,10 @@ module Base_1xOne(){ ////toplevel } module Base_1xThree(){ ////toplevel // Base 1xThree total= 1 rowsz=1 nrows=1 + union(){ + Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -63,6 +75,10 @@ module Base_1xThree(){ ////toplevel } module Base_1xTwo(){ ////toplevel // Base 1xTwo total= 1 rowsz=1 nrows=1 + union(){ + Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 1 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -83,6 +99,10 @@ module Base_1xTwo(){ ////toplevel } module Base_2xFour(){ ////toplevel // Base 2xFour total= 2 rowsz=2 nrows=1 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -104,6 +124,10 @@ module Base_2xFour(){ ////toplevel } module Base_2xOne(){ ////toplevel // Base 2xOne total= 2 rowsz=2 nrows=1 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -125,6 +149,10 @@ module Base_2xOne(){ ////toplevel } module Base_2xThree(){ ////toplevel // Base 2xThree total= 2 rowsz=2 nrows=1 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -146,6 +174,10 @@ module Base_2xThree(){ ////toplevel } module Base_2xTwo(){ ////toplevel // Base 2xTwo total= 2 rowsz=2 nrows=1 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 1 + 0.50 ]); $nspots = 1; @@ -167,6 +199,10 @@ module Base_2xTwo(){ ////toplevel } module Base_3xFour(){ ////toplevel // Base 3xFour total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -189,6 +225,10 @@ module Base_3xFour(){ ////toplevel } module Base_3xOne(){ ////toplevel // Base 3xOne total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -211,6 +251,10 @@ module Base_3xOne(){ ////toplevel } module Base_3xThree(){ ////toplevel // Base 3xThree total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -233,6 +277,10 @@ module Base_3xThree(){ ////toplevel } module Base_3xTwo(){ ////toplevel // Base 3xTwo total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -255,6 +303,10 @@ module Base_3xTwo(){ ////toplevel } module Base_Black(){ ////toplevel // Base Black total=18 rowsz=5 nrows=4 + union(){ + Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -292,6 +344,10 @@ module Base_Black(){ ////toplevel } module Base_Blue(){ ////toplevel // Base Blue total=34 rowsz=6 nrows=6 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); $nspots = 1; @@ -345,6 +401,10 @@ module Base_Blue(){ ////toplevel } module Base_Green(){ ////toplevel // Base Green total=38 rowsz=7 nrows=6 + union(){ + Frame($phase, token_pitch * [ 7 + 1.00, 6 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 7 + 1.00, 6 + 0.50 ]); $nspots = 1; @@ -402,6 +462,10 @@ module Base_Green(){ ////toplevel } module Base_Orange(){ ////toplevel // Base Orange total=20 rowsz=5 nrows=4 + union(){ + Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -441,6 +505,10 @@ module Base_Orange(){ ////toplevel } module Base_Purple(){ ////toplevel // Base Purple total=15 rowsz=4 nrows=4 + union(){ + Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -475,6 +543,10 @@ module Base_Purple(){ ////toplevel } module Base_Red(){ ////toplevel // Base Red total=30 rowsz=6 nrows=5 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); $nspots = 1; @@ -524,6 +596,10 @@ module Base_Red(){ ////toplevel } module Base_White(){ ////toplevel // Base White total=32 rowsz=6 nrows=6 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); $nspots = 1; @@ -575,6 +651,10 @@ module Base_White(){ ////toplevel } module Base_WhiteSpare(){ ////toplevel // Base WhiteSpare total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -597,6 +677,10 @@ module Base_WhiteSpare(){ ////toplevel } module Base_Yellow(){ ////toplevel // Base Yellow total=29 rowsz=6 nrows=5 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); $nspots = 1; @@ -647,6 +731,10 @@ module Base_Yellow(){ ////toplevel // Base max_rowsz=7 max_nrows=6 module All_Black(){ ////toplevel // All Black total=26 rowsz=6 nrows=5 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 5 + 0.50 ]); $nspots = 1; @@ -692,6 +780,10 @@ module All_Black(){ ////toplevel } module All_Blue(){ ////toplevel // All Blue total=52 rowsz=8 nrows=7 + union(){ + Frame($phase, token_pitch * [ 8 + 1.00, 7 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 8 + 1.00, 7 + 0.50 ]); $nspots = 1; @@ -763,6 +855,10 @@ module All_Blue(){ ////toplevel } module All_Green(){ ////toplevel // All Green total=58 rowsz=8 nrows=8 + union(){ + Frame($phase, token_pitch * [ 8 + 1.00, 8 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 8 + 1.00, 8 + 0.50 ]); $nspots = 1; @@ -840,6 +936,10 @@ module All_Green(){ ////toplevel } module All_Orange(){ ////toplevel // All Orange total=32 rowsz=6 nrows=6 + union(){ + Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 6 + 1.00, 6 + 0.50 ]); $nspots = 1; @@ -891,6 +991,10 @@ module All_Orange(){ ////toplevel } module All_Purple(){ ////toplevel // All Purple total=23 rowsz=5 nrows=5 + union(){ + Frame($phase, token_pitch * [ 5 + 1.00, 5 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 5 + 1.00, 5 + 0.50 ]); $nspots = 1; @@ -933,6 +1037,10 @@ module All_Purple(){ ////toplevel } module All_Red(){ ////toplevel // All Red total=46 rowsz=7 nrows=7 + union(){ + Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); $nspots = 1; @@ -998,6 +1106,10 @@ module All_Red(){ ////toplevel } module All_White(){ ////toplevel // All White total=43 rowsz=7 nrows=7 + union(){ + Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); $nspots = 1; @@ -1060,6 +1172,10 @@ module All_White(){ ////toplevel } module All_WhiteSpare(){ ////toplevel // All WhiteSpare total= 3 rowsz=2 nrows=2 + union(){ + Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 2 + 1.00, 2 + 0.50 ]); $nspots = 1; @@ -1082,6 +1198,10 @@ module All_WhiteSpare(){ ////toplevel } module All_Yellow(){ ////toplevel // All Yellow total=45 rowsz=7 nrows=7 + union(){ + Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 7 + 1.00, 7 + 0.50 ]); $nspots = 1; @@ -1148,6 +1268,10 @@ module All_Yellow(){ ////toplevel // All max_rowsz=8 max_nrows=8 module Witches_Black(){ ////toplevel // Witches Black total= 8 rowsz=3 nrows=3 + union(){ + Frame($phase, token_pitch * [ 3 + 1.00, 3 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 3 + 1.00, 3 + 0.50 ]); $nspots = 1; @@ -1175,6 +1299,10 @@ module Witches_Black(){ ////toplevel } module Witches_Blue(){ ////toplevel // Witches Blue total=18 rowsz=5 nrows=4 + union(){ + Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -1212,6 +1340,10 @@ module Witches_Blue(){ ////toplevel } module Witches_Green(){ ////toplevel // Witches Green total=20 rowsz=5 nrows=4 + union(){ + Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 5 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -1251,6 +1383,10 @@ module Witches_Green(){ ////toplevel } module Witches_Orange(){ ////toplevel // Witches Orange total=12 rowsz=4 nrows=3 + union(){ + Frame($phase, token_pitch * [ 4 + 1.00, 3 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 4 + 1.00, 3 + 0.50 ]); $nspots = 1; @@ -1282,6 +1418,10 @@ module Witches_Orange(){ ////toplevel } module Witches_Purple(){ ////toplevel // Witches Purple total= 8 rowsz=3 nrows=3 + union(){ + Frame($phase, token_pitch * [ 3 + 1.00, 3 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 3 + 1.00, 3 + 0.50 ]); $nspots = 1; @@ -1309,6 +1449,10 @@ module Witches_Purple(){ ////toplevel } module Witches_Red(){ ////toplevel // Witches Red total=16 rowsz=4 nrows=4 + union(){ + Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); $nspots = 1; @@ -1344,6 +1488,10 @@ module Witches_Red(){ ////toplevel } module Witches_White(){ ////toplevel // Witches White total=11 rowsz=4 nrows=3 + union(){ + Frame($phase, token_pitch * [ 4 + 1.00, 3 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 4 + 1.00, 3 + 0.50 ]); $nspots = 1; @@ -1374,6 +1522,10 @@ module Witches_White(){ ////toplevel } module Witches_Yellow(){ ////toplevel // Witches Yellow total=16 rowsz=4 nrows=4 + union(){ + Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); + $nspots = 0; + }; union(){ Frame($phase, token_pitch * [ 4 + 1.00, 4 + 0.50 ]); $nspots = 1; -- 2.30.2