3 // Print, for each end:
13 enable_head_cups = false;
15 main_dia = 71.2 + 0.50 - 2.26;
17 top_thick_by_oring = 3.0;
24 rivet_posn = 6.0 + 0.30;
26 rivet_width = 4.15 + 1.0;
27 rivet_tall = 5.51 + 1.49;
29 over_rivet_wall = 1.0;
31 inside_rivet_gap = 1.5;
35 bayo_interf_width = 2.0;
36 bayo_interf_slope = 0.5;
41 oring_upper_embed_angle = 80;
42 oring_compress = 0.1; // proportion
43 oring_compress_more = 0.2;
56 bayo_slice_size = coarse ? 5 : 1;
58 brace_hole_width = 1.0;
59 brace_above_below = 1.2;
60 brace_end_shorter = 0.3;
68 strap_loop_inside = 10;
69 strap_loop_strlen = 10;
70 strap_loop_elevation = 45;
72 sm_inner_circum = 218 - 1.90 - 1.00 - 0.50;
76 sm_bolt_dia = 3.5 + 0.1;
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;
84 sm_bolt_y_clear = 0.75;
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;
104 catch_strap_width = 12;
105 catch_stalk_base_width = 15;
108 catch_knob_above_gap = 5;
109 catch_knob_height = 3.0;
111 catch_stalk_below_gap = 1.0;
112 catch_stalk_beside_gap = 2.0;
118 bayo_entry_x = bayo_entry;
119 bayo_entry_z = bayo_entry;
120 bayo_inramp_x = bayo_inramp;
121 bayo_inramp_z = bayo_inramp;
123 oring_mid_dia = oring_bore + oring_thick;
124 oring_outer_dia = oring_mid_dia + oring_thick;
126 oring_oblate = (1 - oring_compress);
128 oring_y_rad = oring_thick/2 * oring_oblate;
129 oring_x_rad = oring_thick/2 / oring_oblate;
131 by_oring_z = oring_y_rad * (1 + cos(oring_upper_embed_angle));
133 side_height = rivet_posn + bayo_behind + rivet_thick/2;
134 side_thick = rivet_tall + over_rivet_wall;
136 top_z = top_thick_by_oring + oring_y_rad + by_oring_z;
138 middle_bot_z = top_z - top_thick_middle;
140 bayo_top_z = bayo_behind + bayo_gap;
142 bayo_nom_rad = main_dia/2 + side_thick;
143 bayo_real_rad = main_dia/2 + rivet_tall;
145 rivet_entry_width = rivet_width + side_rivet_gap;
147 jig_mark_rad = jig_mark + main_dia/2 + jig_thick;
149 handling_dia = oring_bore + oring_thick*2 + min_wall*2;
152 sm_inner_rad = (sm_inner_circum + sm_bolt_tighten_allow/2) / TAU;
153 sm_outer_rad = sm_inner_rad + sm_main_thick;
155 wm_main_width = sm_main_width;
156 wm_y_min = sqrt( pow(sm_inner_rad, 2) - pow(wm_thick - sm_main_thick, 2) );
158 smc_pos = [ 0, sm_inner_rad, 0 ];
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;
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;
169 catch_cr = catch_knob_dia/2 + catch_stalk_beside_gap;
170 catch_strap_thick = sm_main_thick;
172 echo("R ", sm_inner_rad, bayo_real_rad, bayo_nom_rad);
174 $fs= coarse ? 2.5 : 0.5;
177 include <poster-tube-lid-parametric.scad>
179 // bayonet definition
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] ];
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];
197 bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
199 bayo_polygon = [ bayo_a,
219 cppxC = 0.41 * sm_inner_rad * TAU;
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
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;
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);
240 echo("RR", sm_inner_rad / bayo_nom_rad);
242 // catch assembly depression below pin
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;
256 // catch assembly stalk and so on
258 catch_cr3 = catch_cr + catch_stalk_h;
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] ];
270 catch_assembly_dy = -cppy9 + catch_strap_width;
273 module MainProfile(){
274 main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
277 translate(main_cnr_pos){
280 circle(r = main_cnr);
281 circle(r = main_cnr * 0.5);
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 ],
294 [ -oring_x_rad, by_oring_z ],
298 translate([ oring_mid_dia/2 - main_dia/2, 0 ])
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);
309 module StrapLoopProfile(){
310 circle(r = strap_loop_thick/2);
313 module StrapLoop(){ ////toplevel
314 bigrad = strap_loop_inside/2 + strap_loop_thick/2;
315 extralen = strap_loop_thick * 5;
318 rotate([strap_loop_elevation, 0,0]){
319 for (x= [ -1, +1 ] * bigrad) {
320 translate([x, -extralen, 0])
322 linear_extrude(height= extralen + strap_loop_strlen + 0.1,
326 translate([0, strap_loop_strlen, 0]){
328 rotate_extrude(convexity=10)
329 translate([bigrad, 0,0])
332 cube([100,100,100], center=true);
336 translate([0, 50, 0])
337 cube(100, center=true);
341 module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
342 // nom_rad > real_rad
343 rotate([0,0, atan2(offset, nom_rad) ]){
345 translate([-offset, -10, 0])
347 linear_extrude(height= nom_rad*2, convexity=50)
349 translate([0,0, -25])
350 cylinder(h=50, r= real_rad);
351 translate([0,0, -25])
352 linear_extrude(height= 50, convexity=50)
354 [ -slice_size, -real_rad*2 ],
355 [ +slice_size, -real_rad*2 ] ]);
360 module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
361 offs = [ for (i=[ x_min :
363 x_max + slice_size ]) i ];
366 RotateProjectSlice(off, slice_size, nom_rad, real_rad)
370 module BayonetCutout(){
371 RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
374 translate([-0.5 * (bayo_a[0] + bayo_d[0]), 0])
375 polygon(bayo_polygon, convexity=10);
378 module ProfilesDemo(){ ////toplevel
379 translate([-10,0]) MainProfile();
380 translate([+10, -side_height]) polygon(bayo_polygon, convexity=10);
383 module LimitForHandling(){ ////toplevel
384 hull() for (r=[0,180])
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,
393 cylinder(r= main_cnr, h=50);
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 ]);
406 //cylinder(r= handling_dia/2, h=20);
409 module Cover(){ ////toplevel
410 render() difference(){
413 rotate_extrude(convexity=10)
414 translate([main_dia/2, 0])
416 translate([0,0, middle_bot_z])
417 cylinder(h= top_thick_middle, r = main_dia/2 - top_middle_dr + 1);
423 translate([0,0, -side_height])
425 rotate([0,0, r + asin((-oring_rm_beside) / (main_dia/2))])
427 oring_mid_dia/2 + oring_thick/4 * oring_rm_scale,
429 rotate([-oring_rm_angle, 0, 0])
431 cylinder(r = oring_thick/4 * oring_rm_scale, h=20);
433 for (r=[0 : 60 : 179]) {
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 ]);
442 if (enable_head_cups)
445 translate([-implheadcup_large_dia * .5 - implheadcup_thick/2,
446 -implheadcup_large_dia * .0,
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])
457 translate([0,0, -10])
458 cylinder(r= main_dia/2 - jig_rim, h=20);
461 module Jig(){ ////toplevel
464 translate([0,0, -side_height]){
465 cylinder(r= main_dia/2 + jig_thick, h= side_height + jig_thick);
467 translate([-jig_mark_rad, 0, jig_thick - jig_mark])
468 cube([jig_mark_rad*2, jig_mark, jig_mark]);
470 translate([0,0, -side_height-1])
471 cylinder(r= main_dia/2, h= side_height + 1);
473 translate([0,0, -rivet_posn])
475 translate([0,0, -100])
476 cylinder(r= jig_hole_dia/2, h = 200);
480 module CoverPrint(){ ////toplevel
481 rotate([0,180,0]) Cover();
484 module CoverTest2(){ ////toplevel
491 module CoverTest1(){ ////toplevel
495 for (r= [ 40, 147 ]){
497 translate([0,0, -10]) {
498 cube([ main_dia*3, main_dia * .53, 18], center=true);
502 // translate([ 50, 0, 0 ])
504 // strap_loop_inside + strap_loop_thick*2 + 1,
511 module ImplHeadCupTest(){ ////toplevel
518 module SomeStrap(width){
519 // children(0) is to add, (1) subtract
522 cylinder(r=sm_outer_rad, h=width);
523 StrapMountProtrusion(smc_cnr_c_x + sm_closure_cnr,
530 cylinder(r=sm_inner_rad, h=width+2);
532 StrapMountBolt(10, width);
534 cube([ sm_bolt_tighten_allow, 40,100 ], center=true);
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,
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);
547 translate([ -sm_bolt_shaft/2, 0,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 ])
553 cylinder(r=sm_bolt_head_dia/2, h=sm_bolt_head_thick + l_delta);
557 module StrapMountProtrusion(half_x, max_y, cnr, width){
559 linear_extrude(height=width, convexity=10){
561 for (m = [0,1]) mirror([m,0,0]) {
562 translate([-(half_x - cnr), max_y - cnr])
564 translate([-half_x, -sm_inner_rad])
572 module StrapMount(){ ////toplevel
573 SomeStrap(sm_main_width){
575 StrapMountProtrusion(strap_loop_inside/2 + strap_loop_thick,
580 [0,0, sm_main_width] +
581 strap_loop_thick * [ 0, 0.5, -1.0 ])
588 module WallMount(){ ////toplevel
589 SomeStrap(sm_main_width){
591 linextr(0, sm_main_width){
592 translate([ -sm_outer_rad, wm_y_min ])
593 square([ wm_thick, 20 ]);
600 module CatchAssemblyCoreProfile(){
604 translate(cpp3) circle(r= catch_cr3);
623 translate(cpp8) circle(r= catch_cr);
626 translate(cpp4) circle(r= catch_cr);
627 translate(cpp5) circle(r= catch_cr);
628 translate(cpp7) circle(r= catch_cr);
636 translate(cpp2) circle(r= catch_cr);
638 // if cpp11 is above cpp10, the subtracted hull above
639 // can go down too far. Ensure we do not cut off below cppy6.
644 [ cpp7[0] - catch_cr, cppy6 ],
649 module CatchTipProfile(dy){
654 // circle(r = dist2d(cppF, cppd));
655 //circle(r = dist2d(cppF, cppa));
666 module CatchHeadProfile(){
676 module CatchCore(){ /////toplevel
677 linear_extrude(height=catch_strap_thick, convexity=10)
678 CatchAssemblyCoreProfile();
681 linear_extrude(height=catch_head_th, convexity=10)
683 linear_extrude(height=catch_tip_th, convexity=10)
684 CatchTipProfile(catch_tip_th - catch_head_th);
687 linear_extrude(height=catch_head_th, convexity=10)
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);
697 module CatchPreDistort(){ /////toplevel
698 scale(100 / sm_inner_rad)
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",
712 SomeStrap(catch_strap_width){
715 translate([-200, -200, -200])
716 cube([400, 200, 400]);
721 module CatchDemo(){ /////toplevel
722 color("blue") translate([0,0,
726 translate([0,0,+side_height
731 module CatchDemoS(){ /////toplevel
732 color("blue") translate([0,0,
737 translate([0,0,+side_height
740 mirror([0,1,0]) translate([-250,33,0]) cube([500,500,500]);
744 cube([6.15, 2,2], center=true);
747 module CatchPinProfileDemo(){ /////toplevel
748 translate([0, 0 * -bayo_behind,0]) {
750 bayo_n[0] - bayo_e[0]);
751 color("blue") translate([0,0,
754 CatchAssemblyCoreProfile();
761 polygon(bayo_polygon, convexity=10);
763 // adhoc show a position
768 )) difference(){ circle(2.5); circle(2.0); }