chiark / gitweb /
poster-tube-lid: WallMount wip
[reprap-play.git] / poster-tube-lid.scad
1 // -*- C -*-
2
3 // Print, for each end:
4 //
5 //   CoverPrint
6 //   StrapMount
7 //   CatchAssembly
8
9 include <funcs.scad>
10 include <utils.scad>
11
12 coarse = false;
13 enable_head_cups = false;
14
15 main_dia = 71.2 + 0.50 - 2.26;
16 top_thick_middle = 4;
17 top_thick_by_oring = 3.0;
18 top_middle_dr = 11;
19
20 main_cnr = 6.0;
21
22 min_wall = 3;
23
24 rivet_posn = 6.0 + 0.30;
25 rivet_thick = 1.67;
26 rivet_width = 4.15 + 1.0;
27 rivet_tall = 5.51 + 1.49;
28
29 over_rivet_wall = 1.0;
30 side_rivet_gap = 1.5;
31 inside_rivet_gap = 1.5;
32
33 bayo_interf = 0.30;
34 bayo_behind = 8.5;
35 bayo_interf_width = 2.0;
36 bayo_interf_slope = 0.5;
37
38 oring_thick = 5.0;
39 oring_bore = 62.0;
40
41 oring_upper_embed_angle = 80;
42 oring_compress = 0.1; // proportion
43 oring_compress_more = 0.2;
44
45 oring_rm_beside = 8;
46 oring_rm_scale = 2.0;
47 oring_rm_angle = 20;
48
49 side_taper = 1.0;
50
51 bayo_gap = 6.0;
52
53 bayo_entry = 1.167;
54 bayo_inramp = 0.9;
55
56 bayo_slice_size = coarse ? 5 : 1;
57
58 brace_hole_width = 1.0;
59 brace_above_below = 1.2;
60 brace_end_shorter = 0.3;
61
62 jig_thick = 1.4;
63 jig_hole_dia = 3.0;
64 jig_rim = 5;
65 jig_mark = 5;
66
67 strap_loop_thick = 6;
68 strap_loop_inside = 10;
69 strap_loop_strlen = 10;
70 strap_loop_elevation = 45;
71
72 sm_inner_circum = 218 - 1.90 - 1.00 - 0.50;
73 sm_main_thick = 2.0;
74 sm_main_width = 20;
75
76 sm_bolt_dia = 3.5 + 0.1;
77 sm_bolt_shaft = 21.0;
78 sm_bolt_head_dia = 6.94 + 1.0;
79 sm_bolt_head_thick = 2.14;
80 sm_bolt_nut_width = 5.89 + 0.25;
81 sm_bolt_nut_thick = 3.68;
82 sm_bolt_tighten_allow = 2.0;
83
84 sm_bolt_y_clear = 0.75;
85 sm_bolt_y_over = 0.5;
86
87 sm_closure_cnr = 3.0;
88
89 wm_thick = 5;
90 wm_screw_dia = 4.5; // XXX
91 wm_screw_around = 3.5; // XXX
92 wm_screw_slot = 4.0;
93 wm_csink = 2.5; // XXX
94
95 catch_stalk_h = 4.5;
96 catch_stalk_len = 50;
97 catch_tip_th = 4;
98 catch_head_th = 3;
99
100 catch_pin_slop = 0.25; // each side, and above
101 catch_pin_slop_x_extra = 0.0; // only on one side
102 catch_stalk_above_gap = 1.5;
103 catch_stalk_eff_bend_rad = catch_stalk_len * 0.75;
104
105 catch_strap_width = 12;
106 catch_stalk_base_width = 15;
107
108 catch_knob_dia = 6;
109 catch_knob_above_gap = 5;
110 catch_knob_height = 3.0;
111
112 catch_stalk_below_gap = 1.0;
113 catch_stalk_beside_gap = 2.0;
114
115 // calculated
116
117 TAU = PI*2;
118
119 bayo_entry_x = bayo_entry;
120 bayo_entry_z = bayo_entry;
121 bayo_inramp_x = bayo_inramp;
122 bayo_inramp_z = bayo_inramp;
123
124 oring_mid_dia = oring_bore + oring_thick;
125 oring_outer_dia = oring_mid_dia + oring_thick;
126
127 oring_oblate = (1 - oring_compress);
128
129 oring_y_rad = oring_thick/2 * oring_oblate;
130 oring_x_rad = oring_thick/2 / oring_oblate;
131
132 by_oring_z = oring_y_rad * (1 + cos(oring_upper_embed_angle));
133
134 side_height = rivet_posn + bayo_behind + rivet_thick/2;
135 side_thick = rivet_tall + over_rivet_wall;
136
137 top_z = top_thick_by_oring + oring_y_rad + by_oring_z;
138
139 middle_bot_z = top_z - top_thick_middle;
140
141 bayo_top_z = bayo_behind + bayo_gap;
142
143 bayo_nom_rad = main_dia/2 + side_thick;
144 bayo_real_rad = main_dia/2 + rivet_tall;
145
146 rivet_entry_width = rivet_width + side_rivet_gap;
147
148 jig_mark_rad = jig_mark + main_dia/2 + jig_thick;
149
150 handling_dia = oring_bore + oring_thick*2 + min_wall*2;
151 handling_angle = 45;
152
153 sm_inner_rad = (sm_inner_circum + sm_bolt_tighten_allow/2) / TAU;
154 sm_outer_rad = sm_inner_rad + sm_main_thick;
155
156 wm_main_width = sm_main_width;
157 wm_y_min = sqrt( pow(sm_inner_rad, 2) -
158                  pow(sm_inner_rad - (wm_thick - sm_main_thick), 2) );
159 wm_y_screw = wm_y_min + wm_screw_around + wm_screw_dia/2;
160 wm_y_max = wm_y_screw + wm_screw_dia/2 + wm_screw_around;
161 wm_y_slot1_screw = wm_y_screw + wm_screw_slot;
162 wm_y_slot1_max = wm_y_max + wm_screw_slot;
163
164 smc_pos = [ 0, sm_inner_rad, 0 ];
165
166 smc_bolt_nut_dia = sm_bolt_nut_width / cos(30);
167 smc_bolt_nut_eff_thick = sm_bolt_nut_thick + sm_bolt_tighten_allow;
168
169 smc_bolt_y = sm_bolt_dia/2 + sm_bolt_y_clear;
170 smc_max_y = smc_bolt_y + sm_bolt_y_over
171   + max(sm_bolt_head_dia/2, smc_bolt_nut_dia/2);
172 smc_cnr_c_x = sm_bolt_shaft/2 - sm_closure_cnr
173   + sm_bolt_head_thick/2 + smc_bolt_nut_eff_thick/2;
174
175 catch_cr = catch_knob_dia/2 + catch_stalk_beside_gap;
176 catch_strap_thick = sm_main_thick;
177
178 echo("R ", sm_inner_rad, bayo_real_rad, bayo_nom_rad);
179
180 $fs= coarse ? 2.5 : 0.5;
181 $fa= coarse ? 5 : 1;
182
183 include <poster-tube-lid-parametric.scad>
184
185 // bayonet definition
186
187 bayo_a = [ bayo_entry_x, 0 ];
188 bayo_p = [ 0, bayo_entry_z ];
189 bayo_n = [ 0, bayo_behind-bayo_inramp_z ];
190 bayo_m = [ bayo_inramp_x, bayo_behind ];
191 bayo_l = bayo_m + bayo_interf * [ 1/bayo_interf_slope,  1 ];
192 bayo_k = bayo_l + [ bayo_interf_width, 0 ];
193 bayo_j = bayo_k + bayo_interf * [ 1/bayo_interf_slope, -1 ];
194 bayo_i = bayo_j + [ rivet_width + inside_rivet_gap, 0 ];
195 bayo_h = [ bayo_i[0], bayo_behind + bayo_gap + bayo_interf ];
196 bayo_g = [ bayo_m[0] - rivet_width, bayo_h[1] ];
197
198 bayo_e = [-bayo_p[0], bayo_p[1]] - [rivet_entry_width,0];
199 bayo_d = [-bayo_a[0], bayo_a[1]] - [rivet_entry_width,0];
200 bayo_c = bayo_d + [0,-5];
201 bayo_b = bayo_a + [0,-5];
202
203 bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
204
205 bayo_polygon = [ bayo_a,
206                  bayo_b,
207                  bayo_c,
208                  bayo_d,
209                  bayo_e,
210                  bayo_f,
211                  bayo_g,
212                  bayo_h,
213                  bayo_i,
214                  bayo_j,
215                  bayo_k,
216                  bayo_l,
217                  bayo_m,
218                  bayo_n,
219                  bayo_p ];
220
221 echo(bayo_polygon);
222
223 // CATCH
224
225 cppxC = 0.41 * sm_inner_rad * TAU;
226
227 // catch pin
228
229 cpp_adj = (bayo_n[0] - bayo_f[0]) * (1 - sm_inner_rad / bayo_nom_rad);
230 // radius scaling due to nom and actual radius difference in
231 // bayo entry construction
232
233 cppa = bayo_f + [1,-1] * catch_pin_slop + [1,0] * cpp_adj;
234 cppb = bayo_g + [1,-1] * catch_pin_slop + [1,0] * cpp_adj;
235 cppd = [ bayo_n[0]
236          - catch_pin_slop - catch_pin_slop_x_extra,
237          -catch_stalk_above_gap ];
238 cppi = [ cppa[0], cppd[1] ];
239 cppc = [ cppd[0], cppb[1] ];
240 cpph = cppd + [0,-1] * catch_stalk_h;
241 cppe = cppd + [0,-1] * (catch_knob_above_gap + catch_knob_dia/2);
242 cppf = [ cppa[0], cppe[1] ];
243 cppg = [ cppa[0], cpph[1] ];
244 cppB = 0.5 * (cppf + cppe);
245
246 echo("RR", sm_inner_rad / bayo_nom_rad);
247
248 // catch assembly depression below pin
249
250 cppy6 = cppB[1] - (catch_knob_dia/2
251                    + (cppc[1] - cppd[1])
252                    + catch_stalk_below_gap);
253 cpp7 = [ cppB[0], cppy6 + catch_cr ];
254 cpp11 = cpp7 + [1,0] * catch_cr;
255 cppy9 = cppy6 + catch_strap_width * 1/3;
256 cpp9 = [ cpp7[0] + catch_cr * 2, cppy9 ];
257 cpp8 = cpp9 + [0,-1] * catch_cr;
258 cpp10 = cpp8 + [-1,0] * catch_cr;
259 cppC = [ cppxC, cpp9[1] ];
260 cppD = cppC + [0,-1] * catch_strap_width;
261
262 // catch assembly stalk and so on
263
264 catch_cr3 = catch_cr + catch_stalk_h;
265
266 cppF = [ cppg[0] - catch_stalk_eff_bend_rad, cppd[1] ];
267 cpp4 = [ cppg[0] - catch_stalk_len, cpph[1] ] + [1,-1] * catch_cr;
268 cpp5 = [ cpp4[0], cppC[1] + catch_cr ];
269 cpp2 = cpp5 + [-1,0] * (catch_cr * 2 + catch_stalk_base_width);
270 cpp2r = cpp2 + [1,0] * catch_cr;
271 cpp2d = cpp2 + [0,-1] * catch_cr;
272 cpp3 = [ cpp2[0] + catch_cr + catch_cr3, cppd[1] - catch_cr3 ];
273 cppA = [ -cppxC, cpp9[1] ];
274 cppE = [ cppA[0], cppD[1] ];
275
276 catch_assembly_dy = -cppy9 + catch_strap_width;
277
278
279 module MainProfile(){
280   main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
281   difference(){
282     union(){
283       translate(main_cnr_pos){
284         intersection(){
285           difference(){
286             circle(r = main_cnr);
287             circle(r = main_cnr * 0.5);
288           }
289           square([10,10]);
290         }
291       }
292       polygon([[ -top_middle_dr,        middle_bot_z      ],
293                [ -top_middle_dr,        top_z             ],
294                [ main_cnr_pos[0],       top_z             ],
295                [ side_thick,            main_cnr_pos[1]   ],
296                [ side_thick,            -side_height      ],
297                [ side_taper,            -side_height      ],
298                [ 0,                     -rivet_posn       ],
299                [ 0,                     by_oring_z        ],
300                [ -oring_x_rad,          by_oring_z        ],
301                ],
302               convexity=10);
303     }
304     translate([ oring_mid_dia/2 - main_dia/2, 0 ])
305       hull(){
306       translate([ 0, oring_y_rad ])
307         scale([ 1/oring_oblate * (oring_compress_more+1) , oring_oblate ])
308         circle(oring_thick/2);
309       translate([ 0, oring_y_rad*2 - oring_thick/2 ])
310         circle(oring_thick/2);
311     }
312   }
313 }
314
315 module StrapLoopProfile(){
316   circle(r = strap_loop_thick/2);
317 }
318
319 module StrapLoop(){ ////toplevel
320   bigrad = strap_loop_inside/2 + strap_loop_thick/2;
321   extralen = strap_loop_thick * 5;
322
323   intersection(){
324     rotate([strap_loop_elevation, 0,0]){
325       for (x= [ -1, +1 ] * bigrad) {
326         translate([x, -extralen, 0])
327           rotate([-90,0,0])
328           linear_extrude(height= extralen + strap_loop_strlen + 0.1,
329                          convexity=10)
330           StrapLoopProfile();
331       }
332       translate([0, strap_loop_strlen, 0]){
333         intersection(){
334           rotate_extrude(convexity=10)
335             translate([bigrad, 0,0])
336             StrapLoopProfile();
337           translate([0,50,0])
338             cube([100,100,100], center=true);
339         }
340       }
341     }
342     translate([0, 50, 0])
343       cube(100, center=true);
344   }
345 }
346
347 module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
348   // nom_rad > real_rad
349   rotate([0,0, atan2(offset, nom_rad) ]){
350     intersection(){
351       translate([-offset, -10, 0])
352         rotate([90,0,0])
353         linear_extrude(height= nom_rad*2, convexity=50)
354         children(0);
355       translate([0,0, -25])
356         cylinder(h=50, r= real_rad);
357       translate([0,0, -25])
358         linear_extrude(height= 50, convexity=50)
359         polygon([ [ 0,0 ],
360                   [ -slice_size, -real_rad*2 ],
361                   [ +slice_size, -real_rad*2 ] ]);
362     }
363   }
364 }
365
366 module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
367   offs = [ for (i=[ x_min :
368                     slice_size :
369                     x_max + slice_size ]) i ];
370   echo (offs);
371   for (off=offs)
372     RotateProjectSlice(off, slice_size, nom_rad, real_rad)
373     children(0);
374 }
375
376 module BayonetCutout(){
377   RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
378                 bayo_nom_rad, 
379                 bayo_real_rad)
380     translate([-0.5 * (bayo_a[0] + bayo_d[0]), 0])
381     polygon(bayo_polygon, convexity=10);
382 }
383
384 module ProfilesDemo(){ ////toplevel
385   translate([-10,0]) MainProfile();
386   translate([+10, -side_height]) polygon(bayo_polygon, convexity=10);
387 }
388
389 module LimitForHandling(){ ////toplevel
390   hull() for (r=[0,180])
391     rotate([0,0,r]) {
392       for (rs=[-1,+1]) {
393         for (xd=[0,1]) {
394           rotate([0,0, rs * handling_angle/2]) {
395             translate([rs * xd * main_dia/2 * tan(handling_angle/2),
396                        main_dia/2 + side_thick - main_cnr,
397                        top_z - main_cnr]) {
398               mirror([0,0,1])
399                 cylinder(r= main_cnr, h=50);
400               sphere(main_cnr);
401             }
402           }
403         }
404       } 
405     }
406   hull() rotate_extrude(convexity=10){
407     translate([ handling_dia/2 - main_cnr, top_z - main_cnr ]) {
408       circle(r = main_cnr);
409       mirror([0,1]) square([ main_cnr, 50 ]);
410     }
411   }
412   //cylinder(r= handling_dia/2, h=20);
413 }
414
415 module Cover(){ ////toplevel
416   render() difference(){
417     intersection(){
418       union(){
419         rotate_extrude(convexity=10)
420           translate([main_dia/2, 0])
421           MainProfile();
422         translate([0,0, middle_bot_z])
423           cylinder(h= top_thick_middle, r = main_dia/2 - top_middle_dr + 1);
424       }
425       LimitForHandling();
426     }
427     for (r=[0,180]){
428       rotate([0,0, r])
429         translate([0,0, -side_height])
430         BayonetCutout();
431       rotate([0,0, r + asin((-oring_rm_beside) / (main_dia/2))])
432         translate([0,
433                    oring_mid_dia/2 + oring_thick/4 * oring_rm_scale,
434                    oring_y_rad * 1.5])
435         rotate([-oring_rm_angle, 0, 0])
436         mirror([0,0,1])
437         cylinder(r = oring_thick/4 * oring_rm_scale, h=20);
438     }
439     for (r=[0 : 60 : 179]) {
440       rotate([0,0, r]) {
441         height = top_thick_middle - brace_above_below*2;
442         translate([0,0, middle_bot_z + brace_above_below + height/2 ])
443         cube(center=true, [ oring_bore - brace_end_shorter,
444                             brace_hole_width, height ]);
445       }
446     }
447   }
448   if (enable_head_cups)
449     for (r=[0,180])
450       rotate([0,0,r])
451         translate([-implheadcup_large_dia * .5 - implheadcup_thick/2,
452                    -implheadcup_large_dia * .0,
453                    middle_bot_z + 0.1])
454         ImplHeadCup();
455
456 //  translate(strap_loop_thick * [-0.5, 0, +1])
457 //    translate([handling_dia/2, 0, -side_height])
458 //    rotate([0,180,0]) rotate([0,0,90])
459 //    StrapLoop();
460 }
461
462 module SavingHole(){
463   translate([0,0, -10])
464     cylinder(r= main_dia/2 - jig_rim, h=20);
465 }
466
467 module Jig(){ ////toplevel
468   difference(){
469     union(){
470       translate([0,0, -side_height]){
471         cylinder(r= main_dia/2 + jig_thick, h= side_height + jig_thick);
472       }
473       translate([-jig_mark_rad, 0, jig_thick - jig_mark])
474         cube([jig_mark_rad*2, jig_mark, jig_mark]);
475     }
476     translate([0,0, -side_height-1])
477       cylinder(r= main_dia/2, h= side_height + 1);
478     SavingHole();
479     translate([0,0, -rivet_posn])
480       rotate([90, 0,0])
481       translate([0,0, -100])
482       cylinder(r= jig_hole_dia/2, h = 200);
483   }
484 }
485
486 module CoverPrint(){ ////toplevel
487   rotate([0,180,0]) Cover();
488 }
489
490 module CoverTest2(){ ////toplevel
491   difference(){
492     Cover();
493     SavingHole();
494   }
495 }
496
497 module CoverTest1(){ ////toplevel
498   difference(){
499     CoverTest2();
500     difference(){
501       for (r= [ 40, 147 ]){
502         rotate([0,0, r]){
503           translate([0,0, -10]) {
504             cube([ main_dia*3, main_dia * .53, 18], center=true);
505           }
506         }
507       }
508 //      translate([ 50, 0, 0 ])
509 //      cube([ 100,
510 //             strap_loop_inside + strap_loop_thick*2 + 1,
511 //             100 ],
512 //           center=true);
513     }
514   }
515 }
516
517 module ImplHeadCupTest(){ ////toplevel
518   for (r=[0,180])
519     rotate([0,0,r])
520       translate([-17,0,0])
521       ImplHeadCup();
522 }
523
524 module SomeStrap(width){
525   // children(0) is to add, (1) subtract
526   difference(){
527     union(){
528       cylinder(r=sm_outer_rad, h=width);
529       StrapMountProtrusion(smc_cnr_c_x + sm_closure_cnr,
530                            smc_max_y,
531                            sm_closure_cnr,
532                            width);
533       children(0);
534     }
535     translate([0,0,-1])
536       cylinder(r=sm_inner_rad, h=width+2);
537     translate(smc_pos)
538       StrapMountBolt(10, width);
539     translate(smc_pos)
540       cube([ sm_bolt_tighten_allow, 40,100 ], center=true);
541     children(1);
542   }
543 }
544
545 module StrapMountBolt(l_delta, strap_width){ ///toplevel
546   // positioned relative to smc_pos
547   translate([(smc_bolt_nut_eff_thick - sm_bolt_head_thick)/2,
548              smc_bolt_y,
549              strap_width/2]){
550     translate([ -sm_bolt_shaft/2-1, 0,0 ]){
551       rotate([0,90,0]) cylinder(r= sm_bolt_dia/2, h= sm_bolt_shaft+2);
552     }
553     translate([ -sm_bolt_shaft/2, 0,0 ])
554       rotate([0,-90,0])
555       cylinder($fn=6, r=smc_bolt_nut_dia/2,
556                h=smc_bolt_nut_eff_thick + l_delta);
557     translate([ sm_bolt_shaft/2, 0,0 ])
558       rotate([0,90,0])
559       cylinder(r=sm_bolt_head_dia/2, h=sm_bolt_head_thick + l_delta);
560   }
561 }
562
563 module StrapMountProtrusion(half_x, max_y, cnr, width){
564   translate(smc_pos){
565     linear_extrude(height=width, convexity=10){
566       hull(){
567         for (m = [0,1]) mirror([m,0,0]) {
568           translate([-(half_x - cnr), max_y - cnr])
569             circle(r=cnr);
570           translate([-half_x, -sm_inner_rad])
571             square([1,1]);
572         }
573       }
574     }
575   }
576 }
577
578 module StrapMount(){ ////toplevel
579   SomeStrap(sm_main_width){
580     rotate([0,0,180]){
581       StrapMountProtrusion(strap_loop_inside/2 + strap_loop_thick,
582                            strap_loop_thick,
583                            sm_closure_cnr,
584                            sm_main_width);
585       translate(smc_pos +
586                 [0,0, sm_main_width] +
587                 strap_loop_thick * [ 0, 0.5, -1.0 ])
588         StrapLoop();
589     }
590     union(){ };
591   }
592 }
593
594 module WallMount(){ ////toplevel
595   SomeStrap(sm_main_width){
596     union(){
597       linextr(0, sm_main_width){
598         translate([ -sm_outer_rad, 0 ])
599           rectfromto([ 0, -wm_y_max ],
600                      [ wm_thick, wm_y_slot1_max ]);
601       }
602     }
603     union(){ }
604   }
605 }
606
607 module CatchAssemblyCoreProfile(){
608   difference(){
609     union(){
610       hull(){
611         translate(cpp3) circle(r= catch_cr3);
612         polygon([ cpp3,
613                   cpp2r,
614                   cpp5,
615                   cpph,
616                   cppd
617                   ]);
618       }
619       polygon([cppD,
620                cppC,
621                cpp9,
622                cpp10,
623                cpp11,
624                cpp4,
625                cpp2r,
626                cpp2d,
627                cppA,
628                cppE
629                ]);
630       translate(cpp8) circle(r= catch_cr);
631     }
632     hull(){
633       translate(cpp4) circle(r= catch_cr);
634       translate(cpp5) circle(r= catch_cr);
635       translate(cpp7) circle(r= catch_cr);
636       polygon([cpp4,
637                cppg,
638                cpph,
639                cpp10,
640                cpp11,
641                ]);
642     }
643     translate(cpp2) circle(r= catch_cr);
644   }
645   // if cpp11 is above cpp10, the subtracted hull above
646   // can go down too far.  Ensure we do not cut off below cppy6.
647   polygon([ cppE,
648             cppD,
649             cpp9,
650             [ cpp9[0],            cppy6 ],
651             [ cpp7[0] - catch_cr, cppy6 ],
652             cpp2d
653             ]);
654 }
655
656 module CatchTipProfile(dy){
657   ddy = [0,dy];
658   intersection(){
659     translate(cppF){
660       difference(){
661 //      circle(r = dist2d(cppF, cppd));
662         //circle(r = dist2d(cppF, cppa));
663       }
664     }
665     polygon([ cppa,
666               cppi + ddy,
667               cppd + ddy,
668               cppc,
669               cppb ]);
670   }
671 }
672
673 module CatchHeadProfile(){
674   polygon([ cppd,
675             cppd,
676             cppi,
677             cppf,
678             cppe,
679             cpph ]);
680 }
681
682
683 module CatchCore(){ /////toplevel
684   linear_extrude(height=catch_strap_thick, convexity=10)
685     CatchAssemblyCoreProfile();
686
687   hull(){
688     linear_extrude(height=catch_head_th, convexity=10)
689       CatchTipProfile(0);
690     linear_extrude(height=catch_tip_th, convexity=10)
691       CatchTipProfile(catch_tip_th - catch_head_th);
692   }
693
694   linear_extrude(height=catch_head_th, convexity=10)
695     CatchHeadProfile();
696
697   translate(concat(cppB,[0])) hull(){
698     translate([0,0, catch_knob_height + catch_head_th - catch_knob_dia/2])
699       sphere(r = catch_knob_dia/2);
700     cylinder(r = catch_knob_dia/2, h = 0.1);
701   }
702 }
703
704 module CatchPreDistort(){ /////toplevel
705   scale(100 / sm_inner_rad)
706     rotate([90,0,0])
707     CatchCore();
708 }
709
710 module CatchAssembly(){ /////toplevel
711   rotate([0,0, -(cppe[0] + cppB[0] + catch_pin_slop) / sm_inner_rad * 360/TAU])
712     translate([0,0, catch_assembly_dy])
713     scale(sm_inner_rad / 100)
714     import(str("poster-tube-lid,CatchPostDistort-fa",
715                (coarse ? 20 : 3),
716                ".stl"),
717            convexity=20);
718
719   SomeStrap(catch_strap_width){
720     union(){ }
721     union(){
722       translate([-200, -200, -200])
723         cube([400, 200, 400]);
724     }
725   }
726 }
727
728 module CatchDemo(){ /////toplevel
729   color("blue") translate([0,0,
730                            -catch_assembly_dy
731              ])
732     CatchAssembly();
733   translate([0,0,+side_height
734              ])
735     Cover();
736 }
737
738 module CatchDemoS(){ /////toplevel
739   color("blue") translate([0,0,
740              -catch_assembly_dy
741              ])
742     CatchAssembly();
743   intersection(){
744     translate([0,0,+side_height
745                ])
746       Cover();
747     mirror([0,1,0]) translate([-250,33,0]) cube([500,500,500]);
748   }
749   color("black")
750     translate([0,-33,0])
751     cube([6.15, 2,2], center=true);
752 }
753
754 module CatchPinProfileDemo(){ /////toplevel
755   translate([0, 0 * -bayo_behind,0]) {
756     echo("G ",
757          bayo_n[0] - bayo_e[0]);
758     color("blue") translate([0,0,
759                              +1,
760                ]) {
761       CatchAssemblyCoreProfile();
762       CatchHeadProfile();
763     }
764     translate([0,0,10])
765       color("red")
766       CatchTipProfile(0);
767
768     polygon(bayo_polygon, convexity=10);
769
770     // adhoc show a position
771     color("purple")
772     translate(concat(
773                      cppa,
774                      10
775                      )) difference(){ circle(2.5); circle(2.0); }
776
777  }
778 }
779
780 //ProfilesDemo();
781 //BayonetCutout();
782 //MainProfile();
783 //Cover();
784 //Jig();
785 //CoverTest();