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;
90 wm_screw_dia = 4.5; // XXX
91 wm_screwdriver_dia = 6.0; // XXX
92 wm_screw_around = 4.0; // XXX
94 wm_screw_head = 7.5; // XXX
97 wmb_screw_around = 4; // XXX
98 wmb_screw_depth = 10; // XXX
102 catch_stalk_len = 50;
106 catch_pin_slop = 0.25; // each side, and above
107 catch_pin_slop_x_extra = 0.0; // only on one side
108 catch_stalk_above_gap = 1.5;
109 catch_stalk_eff_bend_rad = catch_stalk_len * 0.75;
111 catch_strap_width = 12;
112 catch_stalk_base_width = 15;
115 catch_knob_above_gap = 5;
116 catch_knob_height = 3.0;
118 catch_stalk_below_gap = 1.0;
119 catch_stalk_beside_gap = 2.0;
125 bayo_entry_x = bayo_entry;
126 bayo_entry_z = bayo_entry;
127 bayo_inramp_x = bayo_inramp;
128 bayo_inramp_z = bayo_inramp;
130 oring_mid_dia = oring_bore + oring_thick;
131 oring_outer_dia = oring_mid_dia + oring_thick;
133 oring_oblate = (1 - oring_compress);
135 oring_y_rad = oring_thick/2 * oring_oblate;
136 oring_x_rad = oring_thick/2 / oring_oblate;
138 by_oring_z = oring_y_rad * (1 + cos(oring_upper_embed_angle));
140 side_height = rivet_posn + bayo_behind + rivet_thick/2;
141 side_thick = rivet_tall + over_rivet_wall;
143 top_z = top_thick_by_oring + oring_y_rad + by_oring_z;
145 middle_bot_z = top_z - top_thick_middle;
147 bayo_top_z = bayo_behind + bayo_gap;
149 bayo_nom_rad = main_dia/2 + side_thick;
150 bayo_real_rad = main_dia/2 + rivet_tall;
152 rivet_entry_width = rivet_width + side_rivet_gap;
154 jig_mark_rad = jig_mark + main_dia/2 + jig_thick;
156 handling_dia = oring_bore + oring_thick*2 + min_wall*2;
159 sm_inner_rad = (sm_inner_circum + sm_bolt_tighten_allow/2) / TAU;
160 sm_outer_rad = sm_inner_rad + sm_main_thick;
162 wm_main_width = sm_main_width;
163 wm_y_min = sqrt( pow(sm_inner_rad, 2) -
164 pow(sm_inner_rad - (wm_thick - sm_main_thick), 2) );
165 wm_y_screw = wm_y_min + wm_screw_around + wm_screw_dia/2;
166 wm_y_max = wm_y_screw + wm_screw_dia/2 + wm_screw_around;
167 wm_y_slotc_screw = wm_y_screw + wm_screw_slot/2;
168 wm_y_slot1_screw = wm_y_screw + wm_screw_slot;
169 wm_y_slot1_max = wm_y_max + wm_screw_slot;
170 wm_z_slot0_screw = wm_main_width + wm_screwdriver_dia/2;
171 wm_z_slotc_screw = wm_z_slot0_screw + wm_screw_slot/2;
172 wm_z_slot1_screw = wm_z_slot0_screw + wm_screw_slot;
173 wm_z_max = wm_z_slot1_screw + wm_screw_around;
175 wmb_mount_cut_rad = sm_outer_rad + wmb_gap;
176 wmb_x_screw = -sm_outer_rad + wmb_screw_around + wmb_screw_dia/2;
177 wmb_y_screw_end = sqrt(
178 pow(wmb_mount_cut_rad, 2) -
182 smc_pos = [ 0, sm_inner_rad, 0 ];
184 smc_bolt_nut_dia = sm_bolt_nut_width / cos(30);
185 smc_bolt_nut_eff_thick = sm_bolt_nut_thick + sm_bolt_tighten_allow;
187 smc_bolt_y = sm_bolt_dia/2 + sm_bolt_y_clear;
188 smc_max_y = smc_bolt_y + sm_bolt_y_over
189 + max(sm_bolt_head_dia/2, smc_bolt_nut_dia/2);
190 smc_cnr_c_x = sm_bolt_shaft/2 - sm_closure_cnr
191 + sm_bolt_head_thick/2 + smc_bolt_nut_eff_thick/2;
193 catch_cr = catch_knob_dia/2 + catch_stalk_beside_gap;
194 catch_strap_thick = sm_main_thick;
196 echo("R ", sm_inner_rad, bayo_real_rad, bayo_nom_rad);
198 $fs= coarse ? 2.5 : 0.5;
201 include <poster-tube-lid-parametric.scad>
203 // bayonet definition
205 bayo_a = [ bayo_entry_x, 0 ];
206 bayo_p = [ 0, bayo_entry_z ];
207 bayo_n = [ 0, bayo_behind-bayo_inramp_z ];
208 bayo_m = [ bayo_inramp_x, bayo_behind ];
209 bayo_l = bayo_m + bayo_interf * [ 1/bayo_interf_slope, 1 ];
210 bayo_k = bayo_l + [ bayo_interf_width, 0 ];
211 bayo_j = bayo_k + bayo_interf * [ 1/bayo_interf_slope, -1 ];
212 bayo_i = bayo_j + [ rivet_width + inside_rivet_gap, 0 ];
213 bayo_h = [ bayo_i[0], bayo_behind + bayo_gap + bayo_interf ];
214 bayo_g = [ bayo_m[0] - rivet_width, bayo_h[1] ];
216 bayo_e = [-bayo_p[0], bayo_p[1]] - [rivet_entry_width,0];
217 bayo_d = [-bayo_a[0], bayo_a[1]] - [rivet_entry_width,0];
218 bayo_c = bayo_d + [0,-5];
219 bayo_b = bayo_a + [0,-5];
221 bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
223 bayo_polygon = [ bayo_a,
243 cppxC = 0.41 * sm_inner_rad * TAU;
247 cpp_adj = (bayo_n[0] - bayo_f[0]) * (1 - sm_inner_rad / bayo_nom_rad);
248 // radius scaling due to nom and actual radius difference in
249 // bayo entry construction
251 cppa = bayo_f + [1,-1] * catch_pin_slop + [1,0] * cpp_adj;
252 cppb = bayo_g + [1,-1] * catch_pin_slop + [1,0] * cpp_adj;
254 - catch_pin_slop - catch_pin_slop_x_extra,
255 -catch_stalk_above_gap ];
256 cppi = [ cppa[0], cppd[1] ];
257 cppc = [ cppd[0], cppb[1] ];
258 cpph = cppd + [0,-1] * catch_stalk_h;
259 cppe = cppd + [0,-1] * (catch_knob_above_gap + catch_knob_dia/2);
260 cppf = [ cppa[0], cppe[1] ];
261 cppg = [ cppa[0], cpph[1] ];
262 cppB = 0.5 * (cppf + cppe);
264 echo("RR", sm_inner_rad / bayo_nom_rad);
266 // catch assembly depression below pin
268 cppy6 = cppB[1] - (catch_knob_dia/2
269 + (cppc[1] - cppd[1])
270 + catch_stalk_below_gap);
271 cpp7 = [ cppB[0], cppy6 + catch_cr ];
272 cpp11 = cpp7 + [1,0] * catch_cr;
273 cppy9 = cppy6 + catch_strap_width * 1/3;
274 cpp9 = [ cpp7[0] + catch_cr * 2, cppy9 ];
275 cpp8 = cpp9 + [0,-1] * catch_cr;
276 cpp10 = cpp8 + [-1,0] * catch_cr;
277 cppC = [ cppxC, cpp9[1] ];
278 cppD = cppC + [0,-1] * catch_strap_width;
280 // catch assembly stalk and so on
282 catch_cr3 = catch_cr + catch_stalk_h;
284 cppF = [ cppg[0] - catch_stalk_eff_bend_rad, cppd[1] ];
285 cpp4 = [ cppg[0] - catch_stalk_len, cpph[1] ] + [1,-1] * catch_cr;
286 cpp5 = [ cpp4[0], cppC[1] + catch_cr ];
287 cpp2 = cpp5 + [-1,0] * (catch_cr * 2 + catch_stalk_base_width);
288 cpp2r = cpp2 + [1,0] * catch_cr;
289 cpp2d = cpp2 + [0,-1] * catch_cr;
290 cpp3 = [ cpp2[0] + catch_cr + catch_cr3, cppd[1] - catch_cr3 ];
291 cppA = [ -cppxC, cpp9[1] ];
292 cppE = [ cppA[0], cppD[1] ];
294 catch_assembly_dy = -cppy9 + catch_strap_width;
297 module MainProfile(){
298 main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
301 translate(main_cnr_pos){
304 circle(r = main_cnr);
305 circle(r = main_cnr * 0.5);
310 polygon([[ -top_middle_dr, middle_bot_z ],
311 [ -top_middle_dr, top_z ],
312 [ main_cnr_pos[0], top_z ],
313 [ side_thick, main_cnr_pos[1] ],
314 [ side_thick, -side_height ],
315 [ side_taper, -side_height ],
318 [ -oring_x_rad, by_oring_z ],
322 translate([ oring_mid_dia/2 - main_dia/2, 0 ])
324 translate([ 0, oring_y_rad ])
325 scale([ 1/oring_oblate * (oring_compress_more+1) , oring_oblate ])
326 circle(oring_thick/2);
327 translate([ 0, oring_y_rad*2 - oring_thick/2 ])
328 circle(oring_thick/2);
333 module StrapLoopProfile(){
334 circle(r = strap_loop_thick/2);
337 module StrapLoop(){ ////toplevel
338 bigrad = strap_loop_inside/2 + strap_loop_thick/2;
339 extralen = strap_loop_thick * 5;
342 rotate([strap_loop_elevation, 0,0]){
343 for (x= [ -1, +1 ] * bigrad) {
344 translate([x, -extralen, 0])
346 linear_extrude(height= extralen + strap_loop_strlen + 0.1,
350 translate([0, strap_loop_strlen, 0]){
352 rotate_extrude(convexity=10)
353 translate([bigrad, 0,0])
356 cube([100,100,100], center=true);
360 translate([0, 50, 0])
361 cube(100, center=true);
365 module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
366 // nom_rad > real_rad
367 rotate([0,0, atan2(offset, nom_rad) ]){
369 translate([-offset, -10, 0])
371 linear_extrude(height= nom_rad*2, convexity=50)
373 translate([0,0, -25])
374 cylinder(h=50, r= real_rad);
375 translate([0,0, -25])
376 linear_extrude(height= 50, convexity=50)
378 [ -slice_size, -real_rad*2 ],
379 [ +slice_size, -real_rad*2 ] ]);
384 module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
385 offs = [ for (i=[ x_min :
387 x_max + slice_size ]) i ];
390 RotateProjectSlice(off, slice_size, nom_rad, real_rad)
394 module BayonetCutout(){
395 RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
398 translate([-0.5 * (bayo_a[0] + bayo_d[0]), 0])
399 polygon(bayo_polygon, convexity=10);
402 module ProfilesDemo(){ ////toplevel
403 translate([-10,0]) MainProfile();
404 translate([+10, -side_height]) polygon(bayo_polygon, convexity=10);
407 module LimitForHandling(){ ////toplevel
408 hull() for (r=[0,180])
412 rotate([0,0, rs * handling_angle/2]) {
413 translate([rs * xd * main_dia/2 * tan(handling_angle/2),
414 main_dia/2 + side_thick - main_cnr,
417 cylinder(r= main_cnr, h=50);
424 hull() rotate_extrude(convexity=10){
425 translate([ handling_dia/2 - main_cnr, top_z - main_cnr ]) {
426 circle(r = main_cnr);
427 mirror([0,1]) square([ main_cnr, 50 ]);
430 //cylinder(r= handling_dia/2, h=20);
433 module Cover(){ ////toplevel
434 render() difference(){
437 rotate_extrude(convexity=10)
438 translate([main_dia/2, 0])
440 translate([0,0, middle_bot_z])
441 cylinder(h= top_thick_middle, r = main_dia/2 - top_middle_dr + 1);
447 translate([0,0, -side_height])
449 rotate([0,0, r + asin((-oring_rm_beside) / (main_dia/2))])
451 oring_mid_dia/2 + oring_thick/4 * oring_rm_scale,
453 rotate([-oring_rm_angle, 0, 0])
455 cylinder(r = oring_thick/4 * oring_rm_scale, h=20);
457 for (r=[0 : 60 : 179]) {
459 height = top_thick_middle - brace_above_below*2;
460 translate([0,0, middle_bot_z + brace_above_below + height/2 ])
461 cube(center=true, [ oring_bore - brace_end_shorter,
462 brace_hole_width, height ]);
466 if (enable_head_cups)
469 translate([-implheadcup_large_dia * .5 - implheadcup_thick/2,
470 -implheadcup_large_dia * .0,
474 // translate(strap_loop_thick * [-0.5, 0, +1])
475 // translate([handling_dia/2, 0, -side_height])
476 // rotate([0,180,0]) rotate([0,0,90])
481 translate([0,0, -10])
482 cylinder(r= main_dia/2 - jig_rim, h=20);
485 module Jig(){ ////toplevel
488 translate([0,0, -side_height]){
489 cylinder(r= main_dia/2 + jig_thick, h= side_height + jig_thick);
491 translate([-jig_mark_rad, 0, jig_thick - jig_mark])
492 cube([jig_mark_rad*2, jig_mark, jig_mark]);
494 translate([0,0, -side_height-1])
495 cylinder(r= main_dia/2, h= side_height + 1);
497 translate([0,0, -rivet_posn])
499 translate([0,0, -100])
500 cylinder(r= jig_hole_dia/2, h = 200);
504 module CoverPrint(){ ////toplevel
505 rotate([0,180,0]) Cover();
508 module CoverTest2(){ ////toplevel
515 module CoverTest1(){ ////toplevel
519 for (r= [ 40, 147 ]){
521 translate([0,0, -10]) {
522 cube([ main_dia*3, main_dia * .53, 18], center=true);
526 // translate([ 50, 0, 0 ])
528 // strap_loop_inside + strap_loop_thick*2 + 1,
535 module ImplHeadCupTest(){ ////toplevel
542 module SomeStrap(width, cut_width=0){
543 // children(0) is to add, (1) subtract
546 cylinder(r=sm_outer_rad, h=width);
547 StrapMountProtrusion(smc_cnr_c_x + sm_closure_cnr,
554 cylinder(r=sm_inner_rad, h=max(width+2, cut_width));
556 StrapMountBolt(10, width);
558 cube([ sm_bolt_tighten_allow, 40,100 ], center=true);
563 module StrapMountBolt(l_delta, strap_width){ ///toplevel
564 // positioned relative to smc_pos
565 translate([(smc_bolt_nut_eff_thick - sm_bolt_head_thick)/2,
568 translate([ -sm_bolt_shaft/2-1, 0,0 ]){
569 rotate([0,90,0]) cylinder(r= sm_bolt_dia/2, h= sm_bolt_shaft+2);
571 translate([ -sm_bolt_shaft/2, 0,0 ])
573 cylinder($fn=6, r=smc_bolt_nut_dia/2,
574 h=smc_bolt_nut_eff_thick + l_delta);
575 translate([ sm_bolt_shaft/2, 0,0 ])
577 cylinder(r=sm_bolt_head_dia/2, h=sm_bolt_head_thick + l_delta);
581 module StrapMountProtrusion(half_x, max_y, cnr, width){
583 linear_extrude(height=width, convexity=10){
585 for (m = [0,1]) mirror([m,0,0]) {
586 translate([-(half_x - cnr), max_y - cnr])
588 translate([-half_x, -sm_inner_rad])
596 module StrapMount(){ ////toplevel
597 SomeStrap(sm_main_width){
599 StrapMountProtrusion(strap_loop_inside/2 + strap_loop_thick,
604 [0,0, sm_main_width] +
605 strap_loop_thick * [ 0, 0.5, -1.0 ])
612 module WallScrewHoleSlot(){ ////toplevel
613 ds = [-1,+1] * wm_screw_slot/2;
614 linextr_x_yz(-(wm_thick + 1), 1) {
618 circle(r = wm_screw_dia/2);
623 translate([0, d, 0]){
625 circle(r = wm_screw_head/2);
626 linextr_x_yz(-(wm_screw_head - wm_screw_dia)/2, 0)
627 circle(r = wm_screw_dia/2);
633 module WallMountMounts(){
634 linextr(0, wm_z_max){
635 translate([ -sm_outer_rad, 0 ])
636 rectfromto([ 0, -wm_y_max ],
637 [ wm_thick, wm_y_slot1_max ]);
640 module WallMountScrewHoles(){
641 translate([ -sm_outer_rad + wm_thick, 0, wm_z_slotc_screw]) {
642 translate([ 0, wm_y_slotc_screw, 0 ])
644 translate([ 0, -wm_y_slotc_screw, 0 ])
650 module WallMount(){ ////toplevel
651 SomeStrap(sm_main_width, wm_z_max + 2){
653 WallMountScrewHoles();
657 module WallMountBaseMounts(){
662 translate([ wmb_x_screw, wmb_y_screw_end ])
664 square(10, center=true);
665 circle(r = wmb_mount_cut_rad);
672 module WallMountForBase(){ ////toplevel
673 SomeStrap(sm_main_width, wm_z_max + 2){
676 WallMountBaseMounts();
679 WallMountScrewHoles();
684 module CatchAssemblyCoreProfile(){
688 translate(cpp3) circle(r= catch_cr3);
707 translate(cpp8) circle(r= catch_cr);
710 translate(cpp4) circle(r= catch_cr);
711 translate(cpp5) circle(r= catch_cr);
712 translate(cpp7) circle(r= catch_cr);
720 translate(cpp2) circle(r= catch_cr);
722 // if cpp11 is above cpp10, the subtracted hull above
723 // can go down too far. Ensure we do not cut off below cppy6.
728 [ cpp7[0] - catch_cr, cppy6 ],
733 module CatchTipProfile(dy){
738 // circle(r = dist2d(cppF, cppd));
739 //circle(r = dist2d(cppF, cppa));
750 module CatchHeadProfile(){
760 module CatchCore(){ /////toplevel
761 linear_extrude(height=catch_strap_thick, convexity=10)
762 CatchAssemblyCoreProfile();
765 linear_extrude(height=catch_head_th, convexity=10)
767 linear_extrude(height=catch_tip_th, convexity=10)
768 CatchTipProfile(catch_tip_th - catch_head_th);
771 linear_extrude(height=catch_head_th, convexity=10)
774 translate(concat(cppB,[0])) hull(){
775 translate([0,0, catch_knob_height + catch_head_th - catch_knob_dia/2])
776 sphere(r = catch_knob_dia/2);
777 cylinder(r = catch_knob_dia/2, h = 0.1);
781 module CatchPreDistort(){ /////toplevel
782 scale(100 / sm_inner_rad)
787 module CatchAssembly(){ /////toplevel
788 rotate([0,0, -(cppe[0] + cppB[0] + catch_pin_slop) / sm_inner_rad * 360/TAU])
789 translate([0,0, catch_assembly_dy])
790 scale(sm_inner_rad / 100)
791 import(str("poster-tube-lid,CatchPostDistort-fa",
796 SomeStrap(catch_strap_width){
799 translate([-200, -200, -200])
800 cube([400, 200, 400]);
805 module CatchDemo(){ /////toplevel
806 color("blue") translate([0,0,
810 translate([0,0,+side_height
815 module CatchDemoS(){ /////toplevel
816 color("blue") translate([0,0,
821 translate([0,0,+side_height
824 mirror([0,1,0]) translate([-250,33,0]) cube([500,500,500]);
828 cube([6.15, 2,2], center=true);
831 module CatchPinProfileDemo(){ /////toplevel
832 translate([0, 0 * -bayo_behind,0]) {
834 bayo_n[0] - bayo_e[0]);
835 color("blue") translate([0,0,
838 CatchAssemblyCoreProfile();
845 polygon(bayo_polygon, convexity=10);
847 // adhoc show a position
852 )) difference(){ circle(2.5); circle(2.0); }