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) -
157 pow(sm_inner_rad - (wm_thick - sm_main_thick), 2) );
159 smc_pos = [ 0, sm_inner_rad, 0 ];
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;
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;
170 catch_cr = catch_knob_dia/2 + catch_stalk_beside_gap;
171 catch_strap_thick = sm_main_thick;
173 echo("R ", sm_inner_rad, bayo_real_rad, bayo_nom_rad);
175 $fs= coarse ? 2.5 : 0.5;
178 include <poster-tube-lid-parametric.scad>
180 // bayonet definition
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] ];
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];
198 bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
200 bayo_polygon = [ bayo_a,
220 cppxC = 0.41 * sm_inner_rad * TAU;
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
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;
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);
241 echo("RR", sm_inner_rad / bayo_nom_rad);
243 // catch assembly depression below pin
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;
257 // catch assembly stalk and so on
259 catch_cr3 = catch_cr + catch_stalk_h;
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] ];
271 catch_assembly_dy = -cppy9 + catch_strap_width;
274 module MainProfile(){
275 main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
278 translate(main_cnr_pos){
281 circle(r = main_cnr);
282 circle(r = main_cnr * 0.5);
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 ],
295 [ -oring_x_rad, by_oring_z ],
299 translate([ oring_mid_dia/2 - main_dia/2, 0 ])
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);
310 module StrapLoopProfile(){
311 circle(r = strap_loop_thick/2);
314 module StrapLoop(){ ////toplevel
315 bigrad = strap_loop_inside/2 + strap_loop_thick/2;
316 extralen = strap_loop_thick * 5;
319 rotate([strap_loop_elevation, 0,0]){
320 for (x= [ -1, +1 ] * bigrad) {
321 translate([x, -extralen, 0])
323 linear_extrude(height= extralen + strap_loop_strlen + 0.1,
327 translate([0, strap_loop_strlen, 0]){
329 rotate_extrude(convexity=10)
330 translate([bigrad, 0,0])
333 cube([100,100,100], center=true);
337 translate([0, 50, 0])
338 cube(100, center=true);
342 module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
343 // nom_rad > real_rad
344 rotate([0,0, atan2(offset, nom_rad) ]){
346 translate([-offset, -10, 0])
348 linear_extrude(height= nom_rad*2, convexity=50)
350 translate([0,0, -25])
351 cylinder(h=50, r= real_rad);
352 translate([0,0, -25])
353 linear_extrude(height= 50, convexity=50)
355 [ -slice_size, -real_rad*2 ],
356 [ +slice_size, -real_rad*2 ] ]);
361 module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
362 offs = [ for (i=[ x_min :
364 x_max + slice_size ]) i ];
367 RotateProjectSlice(off, slice_size, nom_rad, real_rad)
371 module BayonetCutout(){
372 RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
375 translate([-0.5 * (bayo_a[0] + bayo_d[0]), 0])
376 polygon(bayo_polygon, convexity=10);
379 module ProfilesDemo(){ ////toplevel
380 translate([-10,0]) MainProfile();
381 translate([+10, -side_height]) polygon(bayo_polygon, convexity=10);
384 module LimitForHandling(){ ////toplevel
385 hull() for (r=[0,180])
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,
394 cylinder(r= main_cnr, h=50);
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 ]);
407 //cylinder(r= handling_dia/2, h=20);
410 module Cover(){ ////toplevel
411 render() difference(){
414 rotate_extrude(convexity=10)
415 translate([main_dia/2, 0])
417 translate([0,0, middle_bot_z])
418 cylinder(h= top_thick_middle, r = main_dia/2 - top_middle_dr + 1);
424 translate([0,0, -side_height])
426 rotate([0,0, r + asin((-oring_rm_beside) / (main_dia/2))])
428 oring_mid_dia/2 + oring_thick/4 * oring_rm_scale,
430 rotate([-oring_rm_angle, 0, 0])
432 cylinder(r = oring_thick/4 * oring_rm_scale, h=20);
434 for (r=[0 : 60 : 179]) {
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 ]);
443 if (enable_head_cups)
446 translate([-implheadcup_large_dia * .5 - implheadcup_thick/2,
447 -implheadcup_large_dia * .0,
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])
458 translate([0,0, -10])
459 cylinder(r= main_dia/2 - jig_rim, h=20);
462 module Jig(){ ////toplevel
465 translate([0,0, -side_height]){
466 cylinder(r= main_dia/2 + jig_thick, h= side_height + jig_thick);
468 translate([-jig_mark_rad, 0, jig_thick - jig_mark])
469 cube([jig_mark_rad*2, jig_mark, jig_mark]);
471 translate([0,0, -side_height-1])
472 cylinder(r= main_dia/2, h= side_height + 1);
474 translate([0,0, -rivet_posn])
476 translate([0,0, -100])
477 cylinder(r= jig_hole_dia/2, h = 200);
481 module CoverPrint(){ ////toplevel
482 rotate([0,180,0]) Cover();
485 module CoverTest2(){ ////toplevel
492 module CoverTest1(){ ////toplevel
496 for (r= [ 40, 147 ]){
498 translate([0,0, -10]) {
499 cube([ main_dia*3, main_dia * .53, 18], center=true);
503 // translate([ 50, 0, 0 ])
505 // strap_loop_inside + strap_loop_thick*2 + 1,
512 module ImplHeadCupTest(){ ////toplevel
519 module SomeStrap(width){
520 // children(0) is to add, (1) subtract
523 cylinder(r=sm_outer_rad, h=width);
524 StrapMountProtrusion(smc_cnr_c_x + sm_closure_cnr,
531 cylinder(r=sm_inner_rad, h=width+2);
533 StrapMountBolt(10, width);
535 cube([ sm_bolt_tighten_allow, 40,100 ], center=true);
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,
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);
548 translate([ -sm_bolt_shaft/2, 0,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 ])
554 cylinder(r=sm_bolt_head_dia/2, h=sm_bolt_head_thick + l_delta);
558 module StrapMountProtrusion(half_x, max_y, cnr, width){
560 linear_extrude(height=width, convexity=10){
562 for (m = [0,1]) mirror([m,0,0]) {
563 translate([-(half_x - cnr), max_y - cnr])
565 translate([-half_x, -sm_inner_rad])
573 module StrapMount(){ ////toplevel
574 SomeStrap(sm_main_width){
576 StrapMountProtrusion(strap_loop_inside/2 + strap_loop_thick,
581 [0,0, sm_main_width] +
582 strap_loop_thick * [ 0, 0.5, -1.0 ])
589 module WallMount(){ ////toplevel
590 SomeStrap(sm_main_width){
592 linextr(0, sm_main_width){
593 translate([ -sm_outer_rad, wm_y_min ])
594 square([ wm_thick, 20 ]);
601 module CatchAssemblyCoreProfile(){
605 translate(cpp3) circle(r= catch_cr3);
624 translate(cpp8) circle(r= catch_cr);
627 translate(cpp4) circle(r= catch_cr);
628 translate(cpp5) circle(r= catch_cr);
629 translate(cpp7) circle(r= catch_cr);
637 translate(cpp2) circle(r= catch_cr);
639 // if cpp11 is above cpp10, the subtracted hull above
640 // can go down too far. Ensure we do not cut off below cppy6.
645 [ cpp7[0] - catch_cr, cppy6 ],
650 module CatchTipProfile(dy){
655 // circle(r = dist2d(cppF, cppd));
656 //circle(r = dist2d(cppF, cppa));
667 module CatchHeadProfile(){
677 module CatchCore(){ /////toplevel
678 linear_extrude(height=catch_strap_thick, convexity=10)
679 CatchAssemblyCoreProfile();
682 linear_extrude(height=catch_head_th, convexity=10)
684 linear_extrude(height=catch_tip_th, convexity=10)
685 CatchTipProfile(catch_tip_th - catch_head_th);
688 linear_extrude(height=catch_head_th, convexity=10)
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);
698 module CatchPreDistort(){ /////toplevel
699 scale(100 / sm_inner_rad)
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",
713 SomeStrap(catch_strap_width){
716 translate([-200, -200, -200])
717 cube([400, 200, 400]);
722 module CatchDemo(){ /////toplevel
723 color("blue") translate([0,0,
727 translate([0,0,+side_height
732 module CatchDemoS(){ /////toplevel
733 color("blue") translate([0,0,
738 translate([0,0,+side_height
741 mirror([0,1,0]) translate([-250,33,0]) cube([500,500,500]);
745 cube([6.15, 2,2], center=true);
748 module CatchPinProfileDemo(){ /////toplevel
749 translate([0, 0 * -bayo_behind,0]) {
751 bayo_n[0] - bayo_e[0]);
752 color("blue") translate([0,0,
755 CatchAssemblyCoreProfile();
762 polygon(bayo_polygon, convexity=10);
764 // adhoc show a position
769 )) difference(){ circle(2.5); circle(2.0); }