chiark / gitweb /
flyscreen-handle: wip, Ps etc
[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 = 1;
12
13 outside_gap = 3;
14 outside_len = 16;
15 outend_height = 3;
16
17 ourcirc_r = 0.5 / 2;
18
19 opening_protr_slop = 0.1;
20
21 intooth_top_slop = 0.1;
22 inside_h_xgap = 1;
23
24 // calculated
25
26 inside_h = opening_height/2 - opening_protrh - inside_h_xgap/2;
27
28 Q0 = [ openingedge_dia/2,
29        openingedge_dia/2 + opening_height/2 ];
30
31 P0 = [ pivot_x, pivoting_gap ];
32 P4 = Q0 + [ -(openingedge_dia/2 + opening_protr_slop + ourcirc_r), 0 ];
33 P3 = [ P4[0], Q0[1] - openingedge_dia/2 + opening_protrh
34        - intooth_top_slop - ourcirc_r ];
35 P2 = P4 + [ -(inside_len - ourcirc_r*2), 0 ];
36 P1 = [ P2[0], P3[1] - (inside_h + ourcirc_r*2) ];
37 P9 = [ outside_len - ourcirc_r, outside_gap/2 + ourcirc_r ];
38 P8 = P9 + [ 0, outend_height - ourcirc_r*2 ];
39
40 module ExtrusionSect(){
41   cr = openingedge_dia/2;
42   toph = opening_height/2 + opening_protrh;
43
44   for (my=[0,1]) {
45     mirror([0,my]) {
46       translate(Q0) {
47         hull(){
48           circle(r=cr, $fn=20);
49           translate([-cr,10]) square([cr*2, 1]);
50         }
51       }
52     }
53   }
54   translate([-opening_depth, -toph]) {
55     difference(){
56       translate([-5,-5])
57         square([opening_depth+6, toph*2+10]);
58       square([opening_depth+2, toph*2]);
59     }
60   }
61 }
62
63 module PsHull(ps) {
64   hull(){
65     for (p = ps) {
66       translate(p)
67         circle(r = ourcirc_r, $fn=10);
68     }
69   }
70 }
71
72 module LeverSect(){
73   PsHull([P2,P3,P4]);
74   //PsHull([P5,P6,P7]);
75   difference(){
76     PsHull([P0,P1,P2,//P5
77             ,P8,P9]);
78   }
79 }
80
81 module Demo(){
82   color("white") ExtrusionSect();
83   LeverSect();
84 }
85
86 Demo();