chiark / gitweb /
air-hockey-puck: wip
[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.1;
10 hoop_inner_dia = 3.0;
11
12 time_square = 8;
13
14 $fa = 3;
15 $fs = 0.1;
16
17 // caclulated
18
19 loop_post_z = hoop_inner_dia/2;
20 max_z = hoop_inner_dia + hoop_th;
21
22 module Base() {
23   hull(){
24     linextr(-base_th, -base_th + 0.01)
25       square(base, center=true);
26     linextr(-base_th, 0) {
27       square(base - 2 * base_th * base_slope * [1,1], center=true);
28       LoopPlan2();
29     }
30   }
31 }
32
33 module LoopPlan() {
34   translate([hoop_inner_dia/2 + hoop_th/2, 0])
35     circle(r = hoop_th/2);
36 }
37
38 module LoopPlan2() {
39   for (m=[0,1]) {
40     mirror([m,0,0]) LoopPlan();
41   }
42 }
43
44 module Loop() {
45   translate([0,0, loop_post_z]) {
46     intersection(){
47       rotate([90, 0,0]){
48         rotate_extrude(){
49           LoopPlan();
50         }
51       }
52       linextr(-0.1, hoop_inner_dia*2)
53         square(hoop_inner_dia*4, center=true);
54     }
55   }
56   linextr(0, loop_post_z)
57     LoopPlan2();
58 }
59
60 module UseUpTime() {
61   linextr(-base_th, max_z)
62     translate([0, base[0] * 3, 0])
63     square(time_square, center=true);
64 }
65
66 module Whole() {
67   rotate([0,0, 90]) {
68     Base();
69     Loop();
70   }
71   UseUpTime();
72 }
73
74 Whole();