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 echo(condition, $spots_absent, "Y");
39 translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
40 circle(r= spot_dia/2 +
41 ($spots_plusgap ? multicolour_gap : 0));
43 echo(condition, $spots_absent, "N");
48 SpotAt(($nspots % 2) > 0, [0,0]);
49 SpotAt($nspots >= 2, [ 1, 1]);
50 SpotAt($nspots >= 2, [-1,-1]);
51 SpotAt($nspots >= 4, [ 1,-1]);
52 SpotAt($nspots >= 4, [-1, 1]);
55 module Token_Spots_All(){
72 $spots_plusgap = true;
74 linear_extrude(height=thick)
75 circle(r=token_dia/2);
76 Spots_Extrude_Lower() Token_Spots_All();
77 Spots_Extrude_Upper() Token_Spots_All();
92 module Demo(){ ////toplevel
93 color("red") { Token_L3(); }
94 color("white") { Token_L1(); Token_L5(); }
95 color("black") { Token_L2(); Token_L4(); }
99 for ($nspots = [1,2,3,4]) {
100 translate(($nspots - 2) * (token_dia + 3) * [1,0])
105 module Test_L1(){ ////toplevel
108 module Test_L2(){ ////toplevel
111 module Test_L3(){ ////toplevel
114 module Test_L4(){ ////toplevel
117 module Test_L5(){ ////toplevel