// -*- C -*-
-main_dia = 71.2 + 0.50;
+main_dia = 71.2 + 0.50 - 2.26;
top_thick = 4;
main_cnr = 4.0;
rivet_width = 4.15 + 1.0;
rivet_tall = 5.51 + 0.49;
-over_rivet = 0.5;
+over_rivet_wall = 0.5;
+side_rivet_gap = 1.5;
-bayo_interf = 0.75;
+bayo_interf = 1.25;
bayo_behind = 3.5;
+bayo_interf_width = 2.0;
+bayo_interf_slope = 0.75;
-seal_thick = 0.1;
-seal_pocket = 2.0;
+oring_thick = 5.0;
+oring_bore = 62.0;
+
+oring_upper_embed_angle = 80;
+oring_compress = 0.1; // proportion
side_taper = 1.0;
+bayo_above_gap = 1.0;
+
+bayo_entry = bayo_behind/3;
+
+bayo_slice_size = 1;
+
+brace_hole_width = 1.0;
+brace_above_below = 1.2;
+brace_end_shorter = 0.3;
+
+jig_thick = 1.4;
+jig_hole_dia = 3.0;
+jig_rim = 5;
+jig_mark = 5;
+
// calculated
-side_height = rivet_posn + bayo_behind;
-side_thick = rivet_tall + over_rivet;
+bayo_entry_x = bayo_entry;
+bayo_entry_z = bayo_entry;
+bayo_inramp_x = bayo_entry;
+bayo_inramp_z = bayo_entry;
+
+oring_mid_dia = oring_bore + oring_thick;
+oring_outer_dia = oring_mid_dia + oring_thick;
+
+oring_oblate = (1 - oring_compress);
+
+oring_y_rad = oring_thick/2 * oring_oblate;
+oring_x_rad = oring_thick/2 / oring_oblate;
+
+seal_thick = oring_y_rad * (1 + cos(oring_upper_embed_angle));
+
+side_height = rivet_posn + bayo_behind + rivet_thick/2;
+side_thick = rivet_tall + over_rivet_wall;
top_z = top_thick + seal_thick;
+bayo_entry = bayo_behind / 3.0;
+bayo_top_z = bayo_behind + rivet_thick + bayo_above_gap;
+bayo_entry_ramp = bayo_entry + bayo_interf;
+
+rivet_entry_width = rivet_width + side_rivet_gap;
+
+jig_mark_rad = jig_mark + main_dia/2 + jig_thick;
+
$fs=0.5;
-$fa=5;
+$fa=1;
+
+// bayonet definition
+
+bayo_a = [ bayo_entry_x, 0 ];
+bayo_p = [ 0, bayo_entry_z ];
+bayo_n = [ 0, bayo_behind-bayo_inramp_z ];
+bayo_m = [ bayo_inramp_x, bayo_behind ];
+bayo_l = bayo_m + bayo_interf * [ 1/bayo_interf_slope, 1 ];
+bayo_k = bayo_l + [ bayo_interf_width, 0 ];
+bayo_j = bayo_k + bayo_interf * [ 1/bayo_interf_slope, -1 ];
+bayo_i = bayo_j + [ rivet_width, 0 ];
+bayo_h = [ bayo_i[0], bayo_behind + rivet_thick
+ + bayo_above_gap + bayo_interf ];
+bayo_g = [ bayo_m[0] - rivet_width, bayo_h[1] ];
+
+bayo_e = [-bayo_p[0], bayo_p[1]] - [rivet_entry_width,0];
+bayo_d = [-bayo_a[0], bayo_a[1]] - [rivet_entry_width,0];
+bayo_c = bayo_d + [0,-5];
+bayo_b = bayo_a + [0,-5];
+
+bayo_f = [ bayo_e[0], bayo_g[1] + (bayo_e[0] - bayo_g[0]) ];
+
+bayo_polygon = [ bayo_a,
+ bayo_b,
+ bayo_c,
+ bayo_d,
+ bayo_e,
+ bayo_f,
+ bayo_g,
+ bayo_h,
+ bayo_i,
+ bayo_j,
+ bayo_k,
+ bayo_l,
+ bayo_m,
+ bayo_n,
+ bayo_p ];
+
+echo(bayo_polygon);
module MainProfile(){
main_cnr_pos = [ side_thick, top_z ] - [1,1]*main_cnr;
- translate(main_cnr_pos){
+ difference(){
+ union(){
+ translate(main_cnr_pos){
+ intersection(){
+ difference(){
+ circle(r = main_cnr);
+ circle(r = main_cnr * 0.5);
+ }
+ square([10,10]);
+ }
+ }
+ polygon([[ -11, seal_thick ],
+ [ -11, top_z ],
+ [ main_cnr_pos[0], top_z ],
+ [ side_thick, main_cnr_pos[1] ],
+ [ side_thick, -side_height ],
+ [ side_taper, -side_height ],
+ [ 0, -rivet_posn ],
+ [ 0, seal_thick ],
+ ],
+ convexity=10);
+ }
+ translate([ oring_mid_dia/2 - main_dia/2, 0 ])
+ hull(){
+ translate([ 0, oring_y_rad ])
+ scale([ 1/oring_oblate, oring_oblate ])
+ circle(oring_thick/2);
+ translate([ 0, oring_y_rad*2 - oring_thick/2 ])
+ circle(oring_thick/2);
+ }
+ }
+}
+
+module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
+ // nom_rad > real_rad
+ rotate([0,0, atan2(offset, nom_rad) ]){
intersection(){
- difference(){
- circle(r = main_cnr);
- circle(r = main_cnr * 0.5);
+ translate([-offset, -10, 0])
+ rotate([90,0,0])
+ linear_extrude(height= nom_rad*2)
+ children(0);
+ translate([0,0, -25])
+ cylinder(h=50, r= real_rad);
+ translate([0,0, -25])
+ linear_extrude(height= 50)
+ polygon([ [ 0,0 ],
+ [ -slice_size, -real_rad*2 ],
+ [ +slice_size, -real_rad*2 ] ]);
+ }
+ }
+}
+
+module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
+ offs = [ for (i=[ x_min :
+ slice_size :
+ x_max + slice_size ]) i ];
+ echo (offs);
+ for (off=offs)
+ RotateProjectSlice(off, slice_size, nom_rad, real_rad)
+ children(0);
+}
+
+module BayonetCutout(){
+ RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
+ main_dia/2 + side_thick,
+ main_dia/2 + rivet_tall)
+ polygon(bayo_polygon, convexity=10);
+}
+
+module ProfilesDemo(){ ////toplevel
+ translate([-20,0]) MainProfile();
+ polygon(bayo_polygon, convexity=10);
+}
+
+module Cover(){ ////toplevel
+ render() difference(){
+ union(){
+ rotate_extrude(convexity=10)
+ translate([main_dia/2, 0])
+ MainProfile();
+ translate([0,0, seal_thick])
+ cylinder(h= top_thick, r = main_dia/2 - 10);
+ }
+ for (r=[0,180])
+ rotate([0,0, r])
+ translate([0,0, -side_height])
+ BayonetCutout();
+ for (r=[0 : 60 : 179]) {
+ rotate([0,0, r]) {
+ height = top_thick - brace_above_below*2;
+ translate([0,0, seal_thick + brace_above_below + height/2 ])
+ cube(center=true, [ oring_bore - brace_end_shorter,
+ brace_hole_width, height ]);
}
- square([10,10]);
}
}
- %polygon([[ -1, seal_thick ],
- [ -1, top_z ],
- [ main_cnr_pos[0], top_z ],
- [ side_thick, main_cnr_pos[1] ]]);
}
-MainProfile();
+module SavingHole(){
+ translate([0,0, -10])
+ cylinder(r= main_dia/2 - jig_rim, h=20);
+}
+
+module Jig(){ ////toplevel
+ difference(){
+ union(){
+ translate([0,0, -side_height]){
+ cylinder(r= main_dia/2 + jig_thick, h= side_height + jig_thick);
+ }
+ translate([-jig_mark_rad, 0, jig_thick - jig_mark])
+ cube([jig_mark_rad*2, jig_mark, jig_mark]);
+ }
+ translate([0,0, -side_height-1])
+ cylinder(r= main_dia/2, h= side_height + 1);
+ SavingHole();
+ translate([0,0, -rivet_posn])
+ rotate([90, 0,0])
+ translate([0,0, -100])
+ cylinder(r= jig_hole_dia/2, h = 200);
+ }
+}
+
+module CoverTest2(){ ////toplevel
+ difference(){
+ Cover();
+ SavingHole();
+ }
+}
+
+module CoverTest1(){ ////toplevel
+ difference(){
+ CoverTest2();
+ translate([0,0, -10])
+ cube([ main_dia*3, main_dia * .85, 20], center=true);
+ }
+}
+
+//ProfilesDemo();
+//BayonetCutout();
+//MainProfile();
+//Cover();
+//Jig();
+//CoverTest();