multicolour_gap = 0.15; // each side
initial_layer_thick = 0.400;
-//initial_layer_width = 0.750;
+initial_layer_width = 0.750;
final_layer_thick = 0.250;
+multicolour_post = 4;
$nspots = 3;
$spots_absent = false;
if (condition == !$spots_absent) {
echo(condition, $spots_absent, "Y");
translate(xy * (spot_gap + spot_dia) * sqrt(0.5))
- circle(r= spot_dia/2);
+ circle(r= spot_dia/2 +
+ ($spots_plusgap ? multicolour_gap : 0));
} else {
echo(condition, $spots_absent, "N");
}
Token_Spots();
}
-module Demo(){
+module Demo(){ ////toplevel
color("red") { Token_L3(); }
color("white") { Token_L1(); Token_L5(); }
color("black") { Token_L2(); Token_L4(); }
}
-Demo();
+module Frame(phase) {
+ zs = [ initial_layer_thick,
+ initial_layer_thick,
+ thick,
+ thick,
+ thick ];
+
+ base_sz = token_dia * [ 6, 1.5 ];
+ sz = base_sz + phase * initial_layer_width * 2 * [1,1];
+ linear_extrude(height= initial_layer_thick) {
+ difference(){
+ square(center=true, sz + initial_layer_width * 2 * [1,1]);
+ square(center=true, sz);
+ }
+ }
+ translate([-base_sz[0]/2, (phase-3)*(multicolour_post + multicolour_gap)])
+ linear_extrude(height= zs[phase-1])
+ square(multicolour_post);
+}
+
+module Tests(){
+ for ($nspots = [1,2,3,4]) {
+ translate(($nspots - 2) * (token_dia + 3) * [1,0])
+ children();
+ }
+}
+
+module Test_L1(){ ////toplevel
+ Frame(1); Tests() Token_L1();
+}
+module Test_L2(){ ////toplevel
+ Frame(2); Tests() Token_L2();
+}
+module Test_L3(){ ////toplevel
+ Frame(3); Tests() Token_L3();
+}
+module Test_L4(){ ////toplevel
+ Frame(4); Tests() Token_L4();
+}
+module Test_L5(){ ////toplevel
+ Frame(5); Tests() Token_L5();
+}
+
+//Demo();