-rw-r--r-- | multiswitch.scad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/multiswitch.scad b/multiswitch.scad index ae85ee3..2b909a9 100644 --- a/multiswitch.scad +++ b/multiswitch.scad @@ -9,49 +9,49 @@ module multiswitch( liner_od = 4, liner_id = 2, angle = 15, // to the vertical (output) axis inputs = 4, minshell = 2*extrusion_width, shell = 5*extrusion_width, pf = pushfit_embeddest, debug = 0, // how many inputs -1 the debug cutout spans draft = draft, print = true, liner_d_tolerance=.2 ) { fnd = 4*PI; fnr = 2*fnd; pushfit_d = pf_d(pf); pushfit_h = pf_h(pf); angular_step = 360/inputs; lod = liner_od+liner_d_tolerance; // effective liner diameter sinsin = sin(angle)*sin(angular_step/2); function l_to(d) = d*cos(asin(sinsin))/sinsin; l_output = lod; - l_input = l_to(pushfit_d/2+minshell); + l_input = l_to((pushfit_d+minshell)/2); l_fork = l_to(liner_id/2); l_narrow = l_to(lod/2+minshell); module forinputs() { for(zr=[0:angular_step:359]) rotate([0,0,zr]) rotate([0,angle,0]) children(); }//forinputs module module foroutput() { rotate([180,0,0]) children(); } module laydown() { r = pushfit_d/2+shell; h_bottom = l_output+pushfit_h; /* The top point on the cylinder that will touch the bed */ x0 = r*cos(angular_step/2); y0 = r*sin(angular_step/2); z0 = l_input+pushfit_h; /* The same point after rotation by "angle" around Y axis */ x1 = z0*sin(angle)+x0*cos(angle); y1 = y0; z1 = z0*cos(angle)-x0*sin(angle); ax1 = atan(y1/x1); /* And its x-coordinate after final "angular_step/2" Z-rotation */ ax2 = ax1-angular_step/2; |