chiark / gitweb /
flyscreen-handle: LeverSects wip, before Test and before adj P8/P9
[reprap-play.git] / flyscreen-handle.scad
1 // -*- C -*-
2
3 opening_height = 7.84;
4 opening_depth = 7.88;
5 openingedge_dia = 1.34;
6 opening_protrh = 1.8;
7
8 pivot_x = 6;
9 inside_len = 4;
10
11 pivoting_gap = 0.1;
12
13 outside_gap = 3;
14 outside_len = 16;
15 outend_height = 3;
16
17 outside_pushh = 4;
18 outside_pushslope = 1.4;
19
20 ourcirc_r = 0.5 / 2;
21
22 opening_protr_slop = 0.1;
23
24 intooth_top_slop = 0.1;
25 inside_h_xgap = 1;
26
27 pivot_r = 2;
28 pivot_slop = 0.25;
29
30 // calculated
31
32 inside_h = opening_height/2 - opening_protrh - inside_h_xgap/2;
33
34 edge_or = openingedge_dia/2 + opening_protr_slop;
35
36 Q0 = [ openingedge_dia/2,
37        openingedge_dia/2 + opening_height/2 ];
38
39 p4p5d = [edge_or + ourcirc_r, 0];
40
41 P0 = [ pivot_x, pivoting_gap ];
42 P4 = Q0 - p4p5d;
43 P3 = [ P4[0], Q0[1] - openingedge_dia/2 + opening_protrh
44        - intooth_top_slop - ourcirc_r ];
45 P2 = P4 + [ -(inside_len - ourcirc_r*2), 0 ];
46 P1 = [ P2[0], P3[1] - (inside_h + ourcirc_r*2) ];
47 P9 = [ outside_len - ourcirc_r, outside_gap/2 + ourcirc_r ];
48 P8 = P9 + [ 0, outend_height - ourcirc_r*2 ];
49 P5 = Q0 + p4p5d;
50 P6 = P5 + [ 0, outside_pushh - ourcirc_r*2 ];
51 P7 = [ P6[0] + (P6[1] - P1[1]) / outside_pushslope,
52        P1[1] ];
53
54 module ExtrusionSect(){
55   cr = openingedge_dia/2;
56   toph = opening_height/2 + opening_protrh;
57
58   for (my=[0,1]) {
59     mirror([0,my]) {
60       translate(Q0) {
61         hull(){
62           circle(r=cr, $fn=20);
63           translate([-cr,10]) square([cr*2, 1]);
64         }
65       }
66     }
67   }
68   translate([-opening_depth, -toph]) {
69     difference(){
70       translate([-5,-5])
71         square([opening_depth+6, toph*2+10]);
72       square([opening_depth+2, toph*2]);
73     }
74   }
75 }
76
77 module PsHull(ps) {
78   hull(){
79     for (p = ps) {
80       translate(p)
81         circle(r = ourcirc_r, $fn=10);
82     }
83   }
84 }
85
86 module LeverSect(){
87   PsHull([P2,P3,P4]);
88   difference(){
89     PsHull([P0,P1,P2,P5,P8,P9]);
90     translate(Q0) {
91       hull(){
92         circle(r=edge_or, $fn=20);
93         translate([0,10]) circle(r=edge_or, $fn=20);
94       }
95     }
96   }
97 }
98
99 module LeverSectTop(){
100   difference(){
101     LeverSect();
102     translate([pivot_x,0]) circle(r= pivot_r + pivot_slop, $fn=20);
103   }
104 }
105
106 module LeverSectBot(){
107   mirror([0,1]) {
108     LeverSect();
109     PsHull([P5,P6,P7]);
110     translate([pivot_x,0]) circle(r=pivot_r, $fn=20);
111   }
112 }
113
114 module Demo(){
115   translate([0,0,-5]) color("white") ExtrusionSect();
116   LeverSectTop();
117   LeverSectBot();
118 }
119
120 Demo();