chiark / gitweb /
Make README into Markdown
[reprap-play.git] / yubikey-5c-nano-loop.scad
index a0e2add011225b12ac7e70b1956ece91a5d647c0..654e11c7beb88d7ea80f7861916639e47f01ec7d 100644 (file)
@@ -6,23 +6,26 @@ base = [ 8.4, 4.1 ];
 base_th = 0.7;
 base_slope = 2.0;
 
-hoop_th = 2.4;
-hoop_inner_dia = 2.5;
+hoop_th = 2.1;
+hoop_inner_dia = 3.0;
+
+time_square = 8;
 
 $fa = 3;
 $fs = 0.1;
 
 // caclulated
 
+loop_post_z = hoop_inner_dia/2;
+max_z = hoop_inner_dia + hoop_th;
+
 module Base() {
   hull(){
     linextr(-base_th, -base_th + 0.01)
       square(base, center=true);
     linextr(-base_th, 0) {
       square(base - 2 * base_th * base_slope * [1,1], center=true);
-      for (m=[0,1]) {
-       mirror([m,0,0]) LoopPlan();
-      }
+      LoopPlan2();
     }
   }
 }
@@ -32,21 +35,40 @@ module LoopPlan() {
     circle(r = hoop_th/2);
 }
 
+module LoopPlan2() {
+  for (m=[0,1]) {
+    mirror([m,0,0]) LoopPlan();
+  }
+}
+
 module Loop() {
-  intersection(){
-    rotate([90, 0,0]){
-      rotate_extrude(){
-       LoopPlan();
+  translate([0,0, loop_post_z]) {
+    intersection(){
+      rotate([90, 0,0]){
+       rotate_extrude(){
+         LoopPlan();
+       }
       }
+      linextr(-0.1, hoop_inner_dia*2)
+       square(hoop_inner_dia*4, center=true);
     }
-    linextr(-0.1, hoop_inner_dia*2)
-      square(hoop_inner_dia*4, center=true);
   }
+  linextr(0, loop_post_z)
+    LoopPlan2();
+}
+
+module UseUpTime() {
+  linextr(-base_th, max_z)
+    translate([0, base[0] * 3, 0])
+    square(time_square, center=true);
 }
 
 module Whole() {
-  Base();
-  Loop();
+  rotate([0,0, 90]) {
+    Base();
+    Loop();
+  }
+  UseUpTime();
 }
 
 Whole();