5 spot_gap = spot_dia / 3.0;
9 multicolour_gap = 0.075; // each side
10 initial_layer_thick = 0.400;
11 initial_layer_width = 0.750;
12 final_layer_thick = 0.500;
20 token_pitch = token_dia + 3;
24 $spots_absent = false;
25 $spots_plusgap = false;
27 module Spots_Extrude_Lower(){
28 d = $spots_plusgap ? 1 : 0;
30 linear_extrude(height= initial_layer_thick + d)
34 module Spots_Extrude_Upper(){
35 d = $spots_plusgap ? 1 : 0;
36 translate([0,0, thick + d])
38 linear_extrude(height= final_layer_thick + d)
42 module SpotAt(condition, xy) {
43 if (condition == !$spots_absent) {
44 translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
45 circle(r= spot_dia/2 +
46 ($spots_plusgap ? multicolour_gap : 0));
51 SpotAt(($nspots % 2) > 0, [0,0]);
52 SpotAt($nspots >= 2, [ 1, 1]);
53 SpotAt($nspots >= 2, [-1,-1]);
54 SpotAt($nspots >= 4, [ 1,-1]);
55 SpotAt($nspots >= 4, [-1, 1]);
58 module Token_Spots_All(){
75 $spots_plusgap = true;
77 linear_extrude(height=thick)
78 circle(r=token_dia/2);
79 Spots_Extrude_Lower() Token_Spots_All();
80 Spots_Extrude_Upper() Token_Spots_All();
95 module Frame(phase, base_sz) {
96 zs = [ initial_layer_thick,
102 sz = base_sz + phase * initial_layer_width * 2 * [1,1];
103 linear_extrude(height= initial_layer_thick) {
105 square(center=true, sz + initial_layer_width * 2 * [1,1]);
106 square(center=true, sz);
110 translate([-base_sz[0]/2, (3-phase)*(multicolour_post + multicolour_gap)])
111 linear_extrude(height= zs[phase-1])
112 square(multicolour_post);
116 for ($nspots = [1,2,3,4]) {
117 translate(($nspots - 2) * token_pitch * [1,0])
122 module Tests_L() { ////toplevel
123 Frame($phase, token_dia * [ 6, 1.5 ]);
128 include <quacks-ingredients-counts.scad>