5 // ./quacks-ingredients-update-levels
8 // make -j8 quacks-stls 2>&1 | tee log
10 // make -j8 quacks-ingredients-L{1,2,3,4,5},Base_Yellow.auto.stl
12 // ./quacks-ingredients-make-copy-gcodes Base_Yellow etc.
14 // Print Q-P-1 in spots, Q-P-2 in main colour, Q-P-3 in spots
16 // For colours which only have zero-spot counters, print only Q-P-2
20 spot_gap = spot_dia / 3.0;
24 multicolour_gap = 0.075; // each side
25 initial_layer_thick = 0.400;
26 initial_layer_width = 0.750;
27 final_layer_thick = 0.500;
35 token_pitch = token_dia + 3;
39 $spots_absent = false;
40 $spots_plusgap = false;
42 module Spots_Extrude_Lower(){
43 d = $spots_plusgap ? 1 : 0;
45 linear_extrude(height= initial_layer_thick + d)
49 module Spots_Extrude_Upper(){
50 d = $spots_plusgap ? 1 : 0;
51 translate([0,0, thick + d])
53 linear_extrude(height= final_layer_thick + d)
57 module SpotAt(condition, xy) {
58 if (condition == !$spots_absent) {
59 translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
60 circle(r= spot_dia/2 +
61 ($spots_plusgap ? multicolour_gap : 0));
66 SpotAt(($nspots % 2) > 0, [0,0]);
67 SpotAt($nspots >= 2, [ 1, 1]);
68 SpotAt($nspots >= 2, [-1,-1]);
69 SpotAt($nspots >= 4, [ 1,-1]);
70 SpotAt($nspots >= 4, [-1, 1]);
73 module Token_Spots_All(){
90 $spots_plusgap = true;
92 linear_extrude(height=thick)
93 circle(r=token_dia/2);
94 Spots_Extrude_Lower() Token_Spots_All();
95 Spots_Extrude_Upper() Token_Spots_All();
100 $spots_absent = true;
101 Spots_Extrude_Upper()
106 Spots_Extrude_Upper()
110 module Frame(phase, base_sz) {
111 zs = [ initial_layer_thick,
117 sz = base_sz + phase * initial_layer_width * 2 * [1,1];
118 linear_extrude(height= initial_layer_thick) {
120 square(center=true, sz + initial_layer_width * 2 * [1,1]);
121 square(center=true, sz);
125 translate([-base_sz[0]/2, (2.8-phase)*(multicolour_post*1.7)])
126 linear_extrude(height= zs[phase-1])
127 square(multicolour_post);
131 for ($nspots = [1,2,3,4]) {
132 translate(($nspots - 2) * token_pitch * [1,0])
137 module Tests_L() { ////toplevel
138 Frame($phase, token_dia * [ 6, 1.5 ]);
143 include <quacks-ingredients-counts.scad>