chiark / gitweb /
sleepphone-cable-box: support trick, print orientation
[reprap-play.git] / commitid-cube-test.scad
index 722cc01c5618e5a0cc373a5f0a84d088a686f01e..0a5f21a5dc1056588a3a1784df63cf577fe68567 100644 (file)
@@ -6,19 +6,14 @@ baseh= 1;
 
 sz = 20;
 
-h = 0.4;
-
-d = 0.1;
+fdo = [1, 3, 0];
 
 module FD () {
-  scale([2,2,1]) {
-    translate([0.5,1.5,-d])
-    linear_extrude(height= h + d)
+    translate(fdo)
       Commitid_FontDemo();
-  }
 }
 
-module TC () {
+module TC () { ////toplevel
   difference(){
     cube([sz,sz,sz]);
     translate([0,0, sz]) mirror([0,0,1]) FD();
@@ -30,4 +25,50 @@ module TC () {
   translate([0,sz,0]) rotate([-90,0,90]) rotate([0,0,180]) FD();
 }
 
-TC();
+w = 3;
+t = 2;
+
+fdsz = Commitid_FontDemo_sz();
+d = Commitid_depth();
+ru = Commitid_pixelsz();
+
+module TTWall () {
+  difference(){
+    translate([0, 0, -0.1])
+      cube([w, sz, sz - t + 0.1]);
+
+    translate([0,sz,0]) rotate([90,0,-90]) FD();
+    translate([0, sz, 0])
+      rotate([90, 0, -90])
+      translate(fdo + [0, -ru*2, -d]) cube([fdsz[0], ru, d*2]);
+  }
+  translate([w,0,0]) rotate([90,0,90]) FD();
+
+  translate([0, sz+d, 0])
+    rotate([90,0,0])
+    translate([0, fdo[1], 0]) cube([d*2, fdsz[1], ru]);
+}
+
+module TT () { ////toplevel
+  difference(){
+    translate([-sz, 0, -t])
+      cube([sz*2 + w, sz, t]);
+
+    translate([0,0,-t]) rotate([0,180,0]) FD();
+    translate([w,0,0]) rotate([0,0,0]) FD();
+
+    translate([(sz+w), 0, -t]) rotate([0,180,0])
+      Commitid_BestCount([sz+w, sz]);
+  }
+  translate([-sz,0,0]) rotate([0,0,0]) FD();
+
+  TTWall();
+  translate([0,0,-t]) rotate([90,0,0]) TTWall();
+}
+
+echo("pixelsz:", str(Commitid_pixelsz()),
+     "depth:", Commitid_depth(),
+     "sz:", Commitid_FontDemo_sz());
+
+//TC();
+TT();