+module JoinCircs(jr){
+ // http://mathworld.wolfram.com/Circle-CircleIntersection.html
+ R = tube_or + join_cr;
+ r = lock_or[1] + join_cr;
+ d = dist2d( [0,0], lock_0 );
+ x = (d*d - r*r + R*R) / (2*d);
+ y = sqrt( R*R - x*x );
+
+ echo(lock_0x, lock_0y, R,r, d, x,y);
+
+ for (m=[0,1]) {
+ mirror([m,0]) {
+ rotate(atan2(lock_0y, lock_0x)) {
+ translate([x,-y])
+ circle(r= jr);
+ }
+ }
+ }
+}
+
+module DividePlan(xl=10){
+ w = divide_shaft_w;
+ g = divide_gap;
+ l = divide_shaft_l + g;
+ t = divide_head_th + g;
+ dx = divide_head_dx;
+ for (m=[0,1]) mirror([m,0]) {
+ translate([w, 0]) square([xl, g]);
+ for (i=[0:divide_heads-1]) {
+ translate([w, i*(l + t)]) {
+ translate([0, 0]) square([g, l + g]);
+ translate([0, l]) square([divide_head_dx + g, g]);
+ translate([dx, l]) square([g, t + g]);
+ translate([0, l + t])
+ square([divide_head_dx + g, g]);
+ }
+ }
+ translate([-0.1, (l + t) * divide_heads])
+ square([w + g, g]);
+ }
+}
+
+module DividePlanInPlace(xl=10){
+ rotate([0,0, -divide_angle])
+ translate([ -tube_dia/2 -tube_th/2 - divide_fudge_r, 0])
+ DividePlan(xl);
+}
+