-rw-r--r-- | multimixer.scad | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/multimixer.scad b/multimixer.scad new file mode 100644 index 0000000..88fd6bf --- a/dev/null +++ b/multimixer.scad | |||
@@ -0,0 +1,79 @@ | |||
1 | layer_height=.2; extrusion_width=.5; | ||
2 | epsilon=.01; | ||
3 | |||
4 | use <pushfittery.scad>; | ||
5 | include <pushfit_data.scad>; | ||
6 | |||
7 | module multimixer( | ||
8 | filament_d = 1.75, | ||
9 | liner_od = 4, liner_id = 2, | ||
10 | angle = 15, // to the vertical (output) axis | ||
11 | inputs = 4, | ||
12 | minshell = 2*extrusion_width, | ||
13 | shell = 5*extrusion_width, | ||
14 | pf = pushfit_embeddest, | ||
15 | debug = true | ||
16 | ) { | ||
17 | fnd = 4*PI; fnr = 2*fnd; | ||
18 | |||
19 | pushfit_d = pf_d(pf); | ||
20 | pushfit_h = pf_h(pf); | ||
21 | |||
22 | angular_step = 360/inputs; | ||
23 | inputogon_angle = 180*(inputs-2)/inputs; | ||
24 | |||
25 | sinsin = sin(angle)*sin(angular_step/2); | ||
26 | function l_to(d) = d*cos(asin(sinsin))/sinsin; | ||
27 | l_output = liner_od; | ||
28 | l_input = l_to(pushfit_d/2+minshell); | ||
29 | l_fork = l_to(liner_id/2); | ||
30 | l_narrow = l_to(liner_od/2+minshell); | ||
31 | |||
32 | module forinputs() { | ||
33 | for(zr=[0:angular_step:359]) rotate([0,0,zr]) rotate([0,angle,0]) children(); | ||
34 | }//forinputs module | ||
35 | module foroutput() { | ||
36 | rotate([180,0,0]) children(); | ||
37 | } | ||
38 | |||
39 | //translate([pf_d(pf)/2+shell,0,0]) | ||
40 | //translate([0,0,l_output+pushfit_h]) | ||
41 | difference() { | ||
42 | hull() { | ||
43 | forinputs() | ||
44 | translate([0,0,l_input+pushfit_h]) mirror([0,0,1]) | ||
45 | cylinder(d=pushfit_d+shell*2,h=epsilon,$fn=pushfit_d*fnd); | ||
46 | foroutput() | ||
47 | translate([0,0,l_output+pushfit_h]) { | ||
48 | cylinder(d=pushfit_d+shell*2,h=epsilon,$fn=pushfit_d*fnd); | ||
49 | } | ||
50 | } | ||
51 | forinputs() { | ||
52 | translate([0,0,l_input]) pushfit(pf); | ||
53 | translate([0,0,l_narrow]) { | ||
54 | cylinder(d=liner_od,h=l_input+1-l_narrow,$fn=liner_od*fnd); | ||
55 | mirror([0,0,1]) translate([0,0,-epsilon]) | ||
56 | cylinder(d1=(liner_id+liner_od)/2,d2=liner_id,h=liner_id,$fn=liner_od*fnd); | ||
57 | } | ||
58 | cylinder(d=liner_id,h=l_input+epsilon,$fn=liner_id*fnd); | ||
59 | } | ||
60 | foroutput() { | ||
61 | translate([0,0,l_output]) pushfit(pf); | ||
62 | cylinder(d=liner_od,h=l_input+1,$fn=liner_od*fnd); | ||
63 | } | ||
64 | hull() { | ||
65 | forinputs() | ||
66 | translate([0,0,l_fork]) cylinder(d=liner_id,h=epsilon,$fn=liner_id*fnd); | ||
67 | foroutput() | ||
68 | cylinder(d=liner_id,h=epsilon,$fn=liner_id*fnd); | ||
69 | } | ||
70 | if(debug) { | ||
71 | translate([0,0,-20/*TODO:*/]) | ||
72 | rotate_extrude(angle=angular_step) | ||
73 | square([50,100]/*TODO:*/); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | } | ||
78 | |||
79 | multimixer(debug=true); | ||