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