chiark / gitweb /
flyscreen-handle: adjustments from 1st test
[reprap-play.git] / flyscreen-handle.scad
1 // -*- C -*-
2
3 opening_height = 7.84 - 0.3;
4 opening_depth = 7.88;
5 openingcnr_dia = 2.75;
6 opening_topprotr = 1.54;
7
8 gap = 0.25;
9
10 retain_empir_angle = 20;
11 retain_empir_stalkw = 0.8;
12 retain_rad = 1.65;
13 retain_empir_inward = 0.65;
14
15 topprotr_rad = 0.35;
16
17 bot_overlap = 5;
18 bot_w = 3;
19
20 handle_d = 2;
21 handle_w = 8;
22 handle_rh = 2;
23 handle_rcut = 3;
24
25 cutout_gap = 1.5;
26
27 // calculated
28
29 ins_irad = openingcnr_dia/2 + gap;
30 ins_orad = openingcnr_dia/2 + opening_height - gap;
31 ins_th = ins_orad - ins_irad;
32
33 handle_x0 = ins_irad;
34 handle_h = bot_overlap + ins_th;
35 handle_y0 = -ins_orad-bot_overlap;
36 handle_y1 = handle_y0 + handle_h;
37
38 handle_x1 = handle_x0 + bot_w + handle_w;
39
40 module InsertSection(){
41   hull(){
42     translate([-ins_orad, 0]) square([ins_th, 0.1]);
43     translate([-ins_irad - topprotr_rad,
44                opening_topprotr - topprotr_rad])
45       circle(r=topprotr_rad, $fn=10);
46   }
47   translate([0, -ins_orad]) square([ins_irad+1, ins_th]);
48   intersection(){
49     translate([0.1,0.1]) mirror([1,1]) square([100,100]);
50     difference(){
51       circle(r= ins_orad);
52       circle(r= ins_irad, $fn=20);
53     }
54   }
55 }
56
57 module HandleSection(){
58   difference(){
59     hull(){
60       translate([handle_x0, handle_y0])
61         square([bot_w, handle_h]);
62       for (y= [handle_y1 - handle_rh/2,
63                handle_y1 - ins_th + handle_rh/2]) {
64         translate([handle_x1 - handle_rh/2, y])
65           circle(r= handle_rh/2, $fn=20);
66       }
67     }
68     hull(){
69       for (x= [handle_x0 + bot_w + handle_rcut/2,
70                handle_x1 - handle_rh/2 - handle_rcut/2]) {
71         translate([x, handle_y1])
72           circle(r = handle_rcut/2, $fn=20);
73       }
74     }
75   }
76   hull(){
77     for (y= [handle_y1 -   handle_rh/2,
78              handle_y1 - 3*handle_rh/2])
79       translate([handle_x1 - handle_rh/2, y])
80         circle(r = handle_rh/2, $fn=20);
81   }
82 }
83
84 module RetainSection(){
85   rotate(180-retain_empir_angle)
86     translate([0, ins_orad - retain_empir_inward])
87     circle(r=retain_rad, $fn=20);
88 }
89
90 module RetainCutout(gapping=false){
91   rotate(180-retain_empir_angle)
92     translate([0, ins_orad - retain_empir_inward]) {
93     difference(){
94       circle(r=retain_rad + cutout_gap, $fn=20);
95       if (!gapping)
96         rotate(180 + retain_empir_angle/2)
97           translate([0, -retain_empir_stalkw])
98           square([100, retain_empir_stalkw*2]);
99     }
100   }
101 }  
102
103 module GappingSection(){
104   difference(){
105     InsertSection();
106     RetainCutout(true);
107   }
108   HandleSection();
109 }
110
111 module WithRetainSection(){
112   difference(){
113     InsertSection();
114     RetainCutout();
115   }
116   HandleSection();
117   RetainSection();
118 }
119
120 module BasicSection(){
121   InsertSection();
122   HandleSection();
123 }
124
125 module Demo(){
126   difference(){
127     InsertSection();
128     RetainCutout();
129   }
130   HandleSection();
131   color("red") RetainSection();
132 }
133
134 module Test(){
135   linear_extrude(height=2) WithRetainSection();
136 }
137
138 //Demo();
139 WithRetainSection();
140 //BasicSection();
141 //GappingSection();
142 //Test();