chiark / gitweb /
yubikey-5c-nano-loop: posts
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 2 May 2023 15:40:37 +0000 (16:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 2 May 2023 15:40:37 +0000 (16:40 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
yubikey-5c-nano-loop.scad

index c410427fc680f58c803a35e8cf95eefacf2ce130..9c18dd9204b648cd8cf0a6fcbcd1c608ee8eb7fa 100644 (file)
@@ -16,15 +16,16 @@ $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();
     }
   }
 }
@@ -34,20 +35,30 @@ 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, hoop_inner_dia/2 + hoop_th)
+  linextr(-base_th, max_z)
     translate([0, base[0] * 3, 0])
     square(time_square, center=true);
 }