chiark / gitweb /
a30a1b4901c883c250805c7ebf8c74a3757708e7
[reprap-play.git] / poster-tube-lid.scad
1 // -*- C -*-
2
3 main_dia = 71.2 + 0.50;
4 top_thick = 4;
5
6 main_cnr = 4.0;
7
8 rivet_posn = 6.0;
9 rivet_thick = 1.67;
10 rivet_width = 4.15 + 1.0;
11 rivet_tall = 5.51 + 0.49;
12
13 over_rivet_wall = 0.5;
14 side_rivet_gap = 1.5;
15
16 bayo_interf = 0.75;
17 bayo_behind = 3.5;
18 bayo_interf_width = 2.0;
19 bayo_interf_slope = 0.75;
20
21 seal_thick = 0.1;
22 seal_recess = [ 2.0, 2.0 ]; // recess depth, recess height
23
24 side_taper = 1.0;
25
26 bayo_above_gap = 1.0;
27
28 bayo_entry = bayo_behind/3;
29
30 // calculated
31
32 bayo_entry_x = bayo_entry;
33 bayo_entry_z = bayo_entry;
34 bayo_inramp_x = bayo_entry;
35 bayo_inramp_z = bayo_entry;
36
37 side_height = rivet_posn + bayo_behind + rivet_thick/2;
38 side_thick = rivet_tall + over_rivet_wall;
39
40 top_z = top_thick + seal_thick;
41
42 bayo_entry = bayo_behind / 3.0;
43 bayo_top_z = bayo_behind + rivet_thick + bayo_above_gap;
44 bayo_entry_ramp = bayo_entry + bayo_interf;
45
46 rivet_entry_width = rivet_width + side_rivet_gap;
47
48 $fs=0.5;
49 $fa=1;
50
51 // bayonet definition
52
53 bayo_a = [ bayo_entry_x, 0 ];
54 bayo_p = [ 0, bayo_entry_z ];
55 bayo_n = [ 0, bayo_behind-bayo_inramp_z ];
56 bayo_m = [ bayo_inramp_x, bayo_behind ];
57 bayo_l = bayo_m + bayo_interf * [ 1/bayo_interf_slope,  1 ];
58 bayo_k = bayo_l + [ bayo_interf_width, 0 ];
59 bayo_j = bayo_k + bayo_interf * [ 1/bayo_interf_slope, -1 ];
60 bayo_i = bayo_j + [ rivet_width, 0 ];
61 bayo_h = [ bayo_i[0], bayo_behind + rivet_thick + bayo_above_gap ];
62 bayo_g = [ bayo_m[0] - rivet_width, bayo_h[1] ];
63
64 bayo_e = [-bayo_p[0], bayo_p[1]] - [rivet_entry_width,0];
65 bayo_d = [-bayo_a[0], bayo_a[1]] - [rivet_entry_width,0];
66 bayo_c = bayo_d + [0,-5];
67 bayo_b = bayo_a + [0,-5];
68
69 bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
70
71 bayo_polygon = [ bayo_a,
72                  bayo_b,
73                  bayo_c,
74                  bayo_d,
75                  bayo_e,
76                  bayo_f,
77                  bayo_g,
78                  bayo_h,
79                  bayo_i,
80                  bayo_j,
81                  bayo_k,
82                  bayo_l,
83                  bayo_m,
84                  bayo_n,
85                  bayo_p ];
86
87 echo(bayo_polygon);
88
89 module MainProfile(){
90   main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
91   translate(main_cnr_pos){
92     intersection(){
93       difference(){
94         circle(r = main_cnr);
95         circle(r = main_cnr * 0.5);
96       }
97       square([10,10]);
98     }
99   }
100   polygon([[ -1,                    seal_thick        ],
101            [ -1,                    top_z             ],
102            [ main_cnr_pos[0],       top_z             ],
103            [ side_thick,            main_cnr_pos[1]   ],
104            [ side_thick,            -side_height      ],
105            [ side_taper,            -side_height      ],
106            [ 0,                     -rivet_posn       ],
107            [ 0,                     -(seal_recess[0] + seal_recess[1]) ],
108            [ seal_recess[0],        -(seal_recess[0]) ],
109            [ seal_recess[0],        seal_thick        ],
110            ]);
111 }
112
113 module BayonetCutout(){
114   offset = 5;
115   intersection(){
116     translate([offset, -10, 0])
117       rotate([90,0,0])
118       linear_extrude(height= main_dia*2)
119       polygon(bayo_polygon);
120     translate([0,0, -25])
121       cylinder(h=50, r= main_dia/2 + rivet_tall);
122   }
123 }
124
125 module ProfilesDemo(){
126   translate([-20,0]) MainProfile();
127   polygon(bayo_polygon);
128 }
129
130 //ProfilesDemo();
131 BayonetCutout();