update puzzle to latest version to match solution instructions
[ozzloy@gmail.com/3d-printables] / place-value-manipulative.scad
index f372db1ba670a0e8e48e2bcfb653ef6d876fb265..85cf0fd7fb32b71a01aff28b1276aa16768f3638 100644 (file)
@@ -4,7 +4,23 @@
   please do not remove this notice.
 */
 
-ones_place();
+/*****************************************************/
+/* binary */
+//ones_place();
+//twos_place();
+//fours_place();
+//eights_place();
+
+/*****************************************************/
+/* trinary */
+//ones_place();
+//threes_place();
+//nines_place();
+twenty_sevens_place();
+
+/*****************************************************/
+/* decimal */
+//ones_place();
 //tens_place();
 //hundreds_place();
 //thousands_place();
@@ -15,7 +31,7 @@ ones_place();
 $fn = 100;
 
 // how big each ones place side is in millimeters
-side_length = 10;
+side_length = 20;
 
 // modify this to your aesthetic taste
 corner_radius = side_length / 6;
@@ -33,7 +49,7 @@ module round_inside_corners(r) {
 module round_outside_corners(r) {
   fillet(-r) children(); }
 
-module connector_base(connector_thickness) {
+module connector_tab(connector_thickness) {
   rotate([0, -90, -90]) {
     translate([corner_radius / 2, 0, 0]) {
       linear_extrude(height = connector_thickness) {
@@ -50,41 +66,70 @@ module ones_place() {
       round_outside_corners(corner_radius) {
         square(side_length); } }
     translate([side_length / 2, -fudge, -fudge]) {
-      connector_base(connector_thickness); }
+      connector_tab(connector_thickness); }
     translate([side_length / 2,
                side_length - connector_thickness + fudge,
                -fudge]) {
-      connector_base(connector_thickness); } }
+      connector_tab(connector_thickness); } }
   translate([side_length / 2,
              0,
              side_length - 2 * fudge]) {
-    connector_base(connector_thickness - 2 * fudge); }
+    connector_tab(connector_thickness - 2 * fudge); }
   translate([side_length / 2,
              side_length - connector_thickness + 2 * fudge,
              side_length - 2 * fudge]) {
-    connector_base(connector_thickness - 2 * fudge); } }
+    connector_tab(connector_thickness - 2 * fudge); } }
 
+/*****************************************************/
+/* decimal */
 module tens_place() {
   for(ones_index = [0 : (10 - 1)]) {
-    translate([ones_index * side_length, 0]) {
+    translate([ones_index * side_length, 0, 0]) {
       ones_place(); } } }
 
 module hundreds_place() {
   for(tens_index = [0 : (10 - 1)]) {
-    for(ones_index = [0 : (10 - 1)]) {
-      translate([ones_index * side_length,
-                 tens_index * side_length]) {
-        ones_place(); } } } }
+    translate([0, tens_index * side_length, 0]) {
+      tens_place(); } } }
 
 module thousands_place() {
   for(hundreds_index = [0 : (10 - 1)]) {
-    for(tens_index = [0 : (10 - 1)]) {
-      for(ones_index = [0 : (10 - 1)]) {
-        translate([ones_index * side_length,
-                   tens_index * side_length,
-                   hundreds_index * side_length]) {
-          ones_place(); } } } } }
+        translate([0, 0, hundreds_index * side_length]) {
+          hundreds_place(); } } }
 
 
+/*****************************************************/
+/* binary */
+module twos_place() {
+  for(ones_index = [0 : (2 - 1)]) {
+    translate([ones_index * side_length, 0, 0]) {
+      ones_place(); } } }
+
+module fours_place() {
+  for(twos_index = [0 : (2 - 1)]) {
+    translate([0, twos_index * side_length, 0]) {
+      twos_place(); } } }
+
+module eights_place() {
+  for(fours_index = [0 : (2 - 1)]) {
+        translate([0, 0, fours_index * side_length]) {
+          fours_place(); } } }
+
+/*****************************************************/
+/* trinary */
+module threes_place() {
+  for(ones_index = [0 : (3 - 1)]) {
+    translate([ones_index * side_length, 0, 0]) {
+      ones_place(); } } }
+
+module nines_place() {
+  for(threes_index = [0 : (3 - 1)]) {
+    translate([0, threes_index * side_length, 0]) {
+      threes_place(); } } }
+
+module twenty_sevens_place() {
+  for(nines_index = [0 : (3 - 1)]) {
+        translate([0, 0, nines_index * side_length]) {
+          nines_place(); } } }
 
-//connector_base(connector_thickness);
+//connector_tab(connector_thickness);