chiark / gitweb /
yubikey-5c-nano-loop: time_square
[reprap-play.git] / yubikey-5c-nano-loop.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 base = [ 8.4, 4.1 ];
6 base_th = 0.7;
7 base_slope = 2.0;
8
9 hoop_th = 2.4;
10 hoop_inner_dia = 2.5;
11
12 time_square = 8;
13
14 $fa = 3;
15 $fs = 0.1;
16
17 // caclulated
18
19 module Base() {
20   hull(){
21     linextr(-base_th, -base_th + 0.01)
22       square(base, center=true);
23     linextr(-base_th, 0) {
24       square(base - 2 * base_th * base_slope * [1,1], center=true);
25       for (m=[0,1]) {
26         mirror([m,0,0]) LoopPlan();
27       }
28     }
29   }
30 }
31
32 module LoopPlan() {
33   translate([hoop_inner_dia/2 + hoop_th/2, 0])
34     circle(r = hoop_th/2);
35 }
36
37 module Loop() {
38   intersection(){
39     rotate([90, 0,0]){
40       rotate_extrude(){
41         LoopPlan();
42       }
43     }
44     linextr(-0.1, hoop_inner_dia*2)
45       square(hoop_inner_dia*4, center=true);
46   }
47 }
48
49 module UseUpTime() {
50   linextr(-base_th, hoop_inner_dia/2 + hoop_th)
51     translate([0, base[0] * 3, 0])
52     square(time_square, center=true);
53 }
54
55 module Whole() {
56   rotate([0,0, 90]) {
57     Base();
58     Loop();
59   }
60   UseUpTime();
61 }
62
63 Whole();