X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=cable-splice-clamp.scad;h=c23c9367563383aa174adc6f4f827aa609449160;hp=b1f6876979f7afd2fd6256a722e05a4c2fac545a;hb=80554664accdac13cc2f4c6ee6c6dd0da04138ce;hpb=2e81016db65692fd06fd31351ea8df75c2e51c72 diff --git a/cable-splice-clamp.scad b/cable-splice-clamp.scad index b1f6876..c23c936 100644 --- a/cable-splice-clamp.scad +++ b/cable-splice-clamp.scad @@ -1,34 +1,83 @@ // -*- C -*- -cable_maxdia = 12; -cable_mindia = 6; +include -wallmin = 1; -wall = 2; +rnom = 9; -delta_ellipse = 0.5; +// alpha is slope angle, which is half of inner concave angle that +// wire sits in +alpha = 40; // degrees -// calculated +// mu is minimum number of cable radii that cable tangent point (line) +// with splint ought to be away from edge of split +mu = 1/4; -outerdia = cable_maxdia / cos(30) + wall*2; -delta_shift = 1 - delta_ellipse; +// wall thickness, and base width as fraction of cable size +wall_r = 1.5 / 6.5; +base_r = 0.75; -module CrossSection(plus=0) { - difference(){ - for (dx = [-plus, 0, plus]) - translate([dx, 0]) - circle(r= outerdia/2, $fn=6); +// for cross-section calculations: +// +// origin O is at intersection of straight line segments forming walls +// C is centre of circle (wire x-section) (of radius r or radius 1) +// which is tangent to lines +// T is said tangent points +// B is inner base point, which is extension of line from B by mu*r + +sina = sin(alpha); +cosa = cos(alpha); +tana = sina/cosa; + +// blah_r is blah where r=1 +// d_AB is distance AB +// dy_AB is " " " vertical component + +d_OT_r = tana; +d_OB_r = tana + mu; + +d_OC_r = 1/cosa; + +dy_OB_r = d_OB_r * sina; + +// *0 and *1 relate to smallest and largest wire +// r[01] is radius +// r10 is radius ratio + +r10 = d_OC_r / dy_OB_r; - scale([cable_maxdia, - cable_maxdia * delta_shift + cable_mindia * delta_ellipse]) - circle(r= 0.5, $fn=30); +r0 = rnom / sqrt(r10); +r1 = rnom * sqrt(r10); - square(center=true, [40, (cable_maxdia-cable_mindia) * delta_shift]); +x_B_r = d_OB_r * cosa; +y_B_r = -dy_OB_r; + +x_T_r = sina; +y_T_r = -tana * sina; + +top_r = wall_r - (d_OC_r - 1); + +echo(r0,r1, "ratio",r1/r0); + +module CrossSection(plus=0) { + difference(){ + polygon([[-0.1, y_T_r * r0], + [x_T_r * r0, y_T_r * r0], + [x_B_r * r1, y_B_r * r1], + [x_B_r * r1 + wall_r * rnom, y_B_r * r1], + [base_r * rnom, top_r * rnom], + [-0.1, top_r * rnom]]); + translate([0, -d_OC_r * r0]) + circle(r = r0); } } -linear_extrude(height=20) - CrossSection(0); +module CrossSectionDemo(){ ////toplevel + CrossSection(); + for (rc=[["red", r1], + ["blue",r0]]) { + color(rc[0]) translate([0, -d_OC_r * rc[1]]) circle(r = rc[1]); + } +} -linear_extrude(height=1) - CrossSection(2); +//CrossSection(); +CrossSectionDemo();