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