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},Yellow.auto.stl
12 // ./quacks-ingredients-make-copy-gcodes Yellow etc.
16 spot_gap = spot_dia / 3.0;
20 multicolour_gap = 0.075; // each side
21 initial_layer_thick = 0.400;
22 initial_layer_width = 0.750;
23 final_layer_thick = 0.500;
31 token_pitch = token_dia + 3;
35 $spots_absent = false;
36 $spots_plusgap = false;
38 module Spots_Extrude_Lower(){
39 d = $spots_plusgap ? 1 : 0;
41 linear_extrude(height= initial_layer_thick + d)
45 module Spots_Extrude_Upper(){
46 d = $spots_plusgap ? 1 : 0;
47 translate([0,0, thick + d])
49 linear_extrude(height= final_layer_thick + d)
53 module SpotAt(condition, xy) {
54 if (condition == !$spots_absent) {
55 translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
56 circle(r= spot_dia/2 +
57 ($spots_plusgap ? multicolour_gap : 0));
62 SpotAt(($nspots % 2) > 0, [0,0]);
63 SpotAt($nspots >= 2, [ 1, 1]);
64 SpotAt($nspots >= 2, [-1,-1]);
65 SpotAt($nspots >= 4, [ 1,-1]);
66 SpotAt($nspots >= 4, [-1, 1]);
69 module Token_Spots_All(){
86 $spots_plusgap = true;
88 linear_extrude(height=thick)
89 circle(r=token_dia/2);
90 Spots_Extrude_Lower() Token_Spots_All();
91 Spots_Extrude_Upper() Token_Spots_All();
102 Spots_Extrude_Upper()
106 module Frame(phase, base_sz) {
107 zs = [ initial_layer_thick,
113 sz = base_sz + phase * initial_layer_width * 2 * [1,1];
114 linear_extrude(height= initial_layer_thick) {
116 square(center=true, sz + initial_layer_width * 2 * [1,1]);
117 square(center=true, sz);
121 translate([-base_sz[0]/2, (2.8-phase)*(multicolour_post*1.7)])
122 linear_extrude(height= zs[phase-1])
123 square(multicolour_post);
127 for ($nspots = [1,2,3,4]) {
128 translate(($nspots - 2) * token_pitch * [1,0])
133 module Tests_L() { ////toplevel
134 Frame($phase, token_dia * [ 6, 1.5 ]);
139 include <quacks-ingredients-counts.scad>