+ difference(){
+ union(){
+ translate(main_cnr_pos){
+ intersection(){
+ difference(){
+ circle(r = main_cnr);
+ circle(r = main_cnr * 0.5);
+ }
+ square([10,10]);
+ }
+ }
+ polygon([[ -top_middle_dr, middle_bot_z ],
+ [ -top_middle_dr, 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, by_oring_z ],
+ [ -oring_x_rad, by_oring_z ],
+ ],
+ convexity=10);
+ }
+ translate([ oring_mid_dia/2 - main_dia/2, 0 ])
+ hull(){
+ translate([ 0, oring_y_rad ])
+ scale([ 1/oring_oblate * (oring_compress_more+1) , oring_oblate ])
+ circle(oring_thick/2);
+ translate([ 0, oring_y_rad*2 - oring_thick/2 ])
+ circle(oring_thick/2);
+ }
+ }
+}
+
+module StrapHoopProfile(){
+ circle(r = strap_hoop_thick/2);
+}
+
+module StrapHoop(){ ////toplevel
+ bigrad = strap_hoop_inside/2 + strap_hoop_thick/2;
+ extralen = strap_hoop_thick * 5;
+
+ intersection(){
+ rotate([strap_hoop_elevation, 0,0]){
+ for (x= [ -1, +1 ] * bigrad) {
+ translate([x, -extralen, 0])
+ rotate([-90,0,0])
+ linear_extrude(height= extralen + strap_hoop_strlen + 0.1,
+ convexity=10)
+ StrapHoopProfile();
+ }
+ translate([0, strap_hoop_strlen, 0]){
+ intersection(){
+ rotate_extrude(convexity=10)
+ translate([bigrad, 0,0])
+ StrapHoopProfile();
+ translate([0,50,0])
+ cube([100,100,100], center=true);
+ }
+ }
+ }
+ translate([0, 50, 0])
+ cube(100, center=true);
+ }
+}
+
+module HandlingProfile(){
+// translate([
+}
+
+module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
+ // nom_rad > real_rad
+ rotate([0,0, atan2(offset, nom_rad) ]){
+ intersection(){
+ 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)
+ translate([-0.5 * (bayo_a[0] + bayo_d[0]), 0])
+ polygon(bayo_polygon, convexity=10);
+}
+
+module ProfilesDemo(){ ////toplevel
+ translate([-10,0]) MainProfile();
+ translate([+10, -side_height]) polygon(bayo_polygon, convexity=10);
+}
+
+module LimitForHandling(){ ////toplevel
+ hull() for (r=[0,180])
+ rotate([0,0,r]) {
+ for (rs=[-1,+1]) {
+ for (xd=[0,1]) {
+ rotate([0,0, rs * handling_angle/2]) {
+ translate([rs * xd * main_dia/2 * tan(handling_angle/2),
+ main_dia/2 + side_thick - main_cnr,
+ top_z - main_cnr]) {
+ mirror([0,0,1])
+ cylinder(r= main_cnr, h=50);
+ sphere(main_cnr);
+ }
+ }
+ }
+ }
+ }
+ hull() rotate_extrude(){
+ translate([ handling_dia/2 - main_cnr, top_z - main_cnr ]) {
+ circle(r = main_cnr);
+ mirror([0,1]) square([ main_cnr, 50 ]);
+ }
+ }
+ //cylinder(r= handling_dia/2, h=20);
+}
+
+module Cover(){ ////toplevel
+ render() difference(){