-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( | |||
9 | liner_od = 4, liner_id = 2, | 9 | liner_od = 4, liner_id = 2, |
10 | angle = 15, // to the vertical (output) axis | 10 | angle = 15, // to the vertical (output) axis |
11 | inputs = 4, | 11 | inputs = 4, |
12 | minshell = 2*extrusion_width, | 12 | minshell = 2*extrusion_width, |
13 | shell = 5*extrusion_width, | 13 | shell = 5*extrusion_width, |
14 | pf = pushfit_embeddest, | 14 | pf = pushfit_embeddest, |
15 | 15 | ||
16 | debug = 0, // how many inputs -1 the debug cutout spans | 16 | debug = 0, // how many inputs -1 the debug cutout spans |
17 | draft = draft, | 17 | draft = draft, |
18 | print = true, | 18 | print = true, |
19 | 19 | ||
20 | liner_d_tolerance=.2 | 20 | liner_d_tolerance=.2 |
21 | ) { | 21 | ) { |
22 | fnd = 4*PI; fnr = 2*fnd; | 22 | fnd = 4*PI; fnr = 2*fnd; |
23 | 23 | ||
24 | pushfit_d = pf_d(pf); | 24 | pushfit_d = pf_d(pf); |
25 | pushfit_h = pf_h(pf); | 25 | pushfit_h = pf_h(pf); |
26 | 26 | ||
27 | angular_step = 360/inputs; | 27 | angular_step = 360/inputs; |
28 | lod = liner_od+liner_d_tolerance; // effective liner diameter | 28 | lod = liner_od+liner_d_tolerance; // effective liner diameter |
29 | 29 | ||
30 | sinsin = sin(angle)*sin(angular_step/2); | 30 | sinsin = sin(angle)*sin(angular_step/2); |
31 | function l_to(d) = d*cos(asin(sinsin))/sinsin; | 31 | function l_to(d) = d*cos(asin(sinsin))/sinsin; |
32 | l_output = lod; | 32 | l_output = lod; |
33 | l_input = l_to(pushfit_d/2+minshell); | 33 | l_input = l_to((pushfit_d+minshell)/2); |
34 | l_fork = l_to(liner_id/2); | 34 | l_fork = l_to(liner_id/2); |
35 | l_narrow = l_to(lod/2+minshell); | 35 | l_narrow = l_to(lod/2+minshell); |
36 | 36 | ||
37 | module forinputs() { | 37 | module forinputs() { |
38 | for(zr=[0:angular_step:359]) rotate([0,0,zr]) rotate([0,angle,0]) children(); | 38 | for(zr=[0:angular_step:359]) rotate([0,0,zr]) rotate([0,angle,0]) children(); |
39 | }//forinputs module | 39 | }//forinputs module |
40 | module foroutput() { | 40 | module foroutput() { |
41 | rotate([180,0,0]) children(); | 41 | rotate([180,0,0]) children(); |
42 | } | 42 | } |
43 | 43 | ||
44 | module laydown() { | 44 | module laydown() { |
45 | r = pushfit_d/2+shell; | 45 | r = pushfit_d/2+shell; |
46 | h_bottom = l_output+pushfit_h; | 46 | h_bottom = l_output+pushfit_h; |
47 | /* The top point on the cylinder that will touch the bed */ | 47 | /* The top point on the cylinder that will touch the bed */ |
48 | x0 = r*cos(angular_step/2); | 48 | x0 = r*cos(angular_step/2); |
49 | y0 = r*sin(angular_step/2); | 49 | y0 = r*sin(angular_step/2); |
50 | z0 = l_input+pushfit_h; | 50 | z0 = l_input+pushfit_h; |
51 | /* The same point after rotation by "angle" around Y axis */ | 51 | /* The same point after rotation by "angle" around Y axis */ |
52 | x1 = z0*sin(angle)+x0*cos(angle); | 52 | x1 = z0*sin(angle)+x0*cos(angle); |
53 | y1 = y0; | 53 | y1 = y0; |
54 | z1 = z0*cos(angle)-x0*sin(angle); | 54 | z1 = z0*cos(angle)-x0*sin(angle); |
55 | ax1 = atan(y1/x1); | 55 | ax1 = atan(y1/x1); |
56 | /* And its x-coordinate after final "angular_step/2" Z-rotation */ | 56 | /* And its x-coordinate after final "angular_step/2" Z-rotation */ |
57 | ax2 = ax1-angular_step/2; | 57 | ax2 = ax1-angular_step/2; |