5 spot_gap = spot_dia / 3.0;
9 multicolour_gap = 0.15; // each side
10 initial_layer_thick = 0.400;
11 initial_layer_width = 0.750;
12 final_layer_thick = 0.250;
15 $spots_absent = false;
16 $spots_plusgap = false;
21 module Spots_Extrude_Lower(){
22 d = $spots_plusgap ? 1 : 0;
24 linear_extrude(height= initial_layer_thick + d)
28 module Spots_Extrude_Upper(){
29 d = $spots_plusgap ? 1 : 0;
30 translate([0,0, thick + d])
32 linear_extrude(height= final_layer_thick + d)
36 module SpotAt(condition, xy) {
37 if (condition == !$spots_absent) {
38 translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
39 circle(r= spot_dia/2 +
40 ($spots_plusgap ? multicolour_gap : 0));
45 SpotAt(($nspots % 2) > 0, [0,0]);
46 SpotAt($nspots >= 2, [ 1, 1]);
47 SpotAt($nspots >= 2, [-1,-1]);
48 SpotAt($nspots >= 4, [ 1,-1]);
49 SpotAt($nspots >= 4, [-1, 1]);
52 module Token_Spots_All(){
69 $spots_plusgap = true;
71 linear_extrude(height=thick)
72 circle(r=token_dia/2);
73 Spots_Extrude_Lower() Token_Spots_All();
74 Spots_Extrude_Upper() Token_Spots_All();
90 zs = [ initial_layer_thick,
96 base_sz = token_dia * [ 6, 1.5 ];
97 sz = base_sz + phase * initial_layer_width * 2 * [1,1];
98 linear_extrude(height= initial_layer_thick) {
100 square(center=true, sz + initial_layer_width * 2 * [1,1]);
101 square(center=true, sz);
105 translate([-base_sz[0]/2, (3-phase)*(multicolour_post + multicolour_gap)])
106 linear_extrude(height= zs[phase-1])
107 square(multicolour_post);
111 for ($nspots = [1,2,3,4]) {
112 translate(($nspots - 2) * (token_dia + 3) * [1,0])
117 module Test_L() { ////toplevel
118 Frame($phase); Tests() Token_L();