-rw-r--r-- | mixing.scad | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mixing.scad b/mixing.scad index ecbdfd8..fae9d52 100644 --- a/mixing.scad +++ b/mixing.scad | |||
@@ -4,7 +4,7 @@ defaultvolume=20*10*20; /* volume for testing */ | |||
4 | /* side of the cube, containing half the volume */ | 4 | /* side of the cube, containing half the volume */ |
5 | function mixing_hvs(volume=defaultvolume) = pow(volume/2,1/3); | 5 | function mixing_hvs(volume=defaultvolume) = pow(volume/2,1/3); |
6 | /* vessel dimensions */ | 6 | /* vessel dimensions */ |
7 | function mixing_size(volume=defaultvolume) = let(hvs = mixing_hvs(volume=volume)) [2*hvs+3*s,hvs+2*s,hvs+2*s]; | 7 | function mixing_size(volume=defaultvolume) = let(hvs = mixing_hvs(volume=volume)) [2*hvs+3*s,hvs+2*s,hvs+3*s]; |
8 | 8 | ||
9 | module mixing( | 9 | module mixing( |
10 | volume=defaultvolume,/* volume in cubic mm */ | 10 | volume=defaultvolume,/* volume in cubic mm */ |
@@ -12,12 +12,12 @@ module mixing( | |||
12 | ) { | 12 | ) { |
13 | g=1; /* guide diameter */ | 13 | g=1; /* guide diameter */ |
14 | hvs = mixing_hvs(volume=volume); | 14 | hvs = mixing_hvs(volume=volume); |
15 | sz = mixing_size(volume=volume); | ||
15 | if(what=="vessel") { | 16 | if(what=="vessel") { |
16 | sz = mixing_size(volume=volume); | ||
17 | translate([-sz[0]/2,-sz[1]/2,0]) difference() { | 17 | translate([-sz[0]/2,-sz[1]/2,0]) difference() { |
18 | cube(size=sz); | 18 | cube(size=sz); |
19 | translate([s,s,s]) | 19 | translate([s,s,s]) |
20 | cube(size=[2*hvs+s,hvs,hvs+s+1]); | 20 | cube(size=[2*hvs+s,hvs,sz[2]+1]); |
21 | } | 21 | } |
22 | for(mx=[0,1]) mirror([mx,0,0]) { | 22 | for(mx=[0,1]) mirror([mx,0,0]) { |
23 | // horizontal guide | 23 | // horizontal guide |
@@ -25,8 +25,8 @@ module mixing( | |||
25 | for(my=[0,1]) mirror([0,my,0]) { | 25 | for(my=[0,1]) mirror([0,my,0]) { |
26 | // vertical guide + crowning sphere | 26 | // vertical guide + crowning sphere |
27 | translate([s/2+g/2,hvs/2,0]) { | 27 | translate([s/2+g/2,hvs/2,0]) { |
28 | cylinder(d=g,h=hvs+2*s-g/2,$fn=12); | 28 | cylinder(d=g,h=sz[2]-g/2,$fn=12); |
29 | translate([0,0,s+hvs+s-g/2]) sphere(d=g,$fn=12); | 29 | translate([0,0,sz[2]-g/2]) sphere(d=g,$fn=12); |
30 | } | 30 | } |
31 | } | 31 | } |
32 | // level | 32 | // level |
@@ -38,14 +38,15 @@ module mixing( | |||
38 | } | 38 | } |
39 | } | 39 | } |
40 | }else if(what=="splitter") { | 40 | }else if(what=="splitter") { |
41 | z1 = sz[2]; z2 = 2*z1; | ||
41 | hull() { | 42 | hull() { |
42 | translate([-s/2,-hvs/2,0]) cube(size=[s,hvs,hvs+2*s]); | 43 | translate([-s/2,-hvs/2,0]) cube(size=[s,hvs,z1]); |
43 | cd=hvs/2; | 44 | cd=hvs/2; |
44 | for(yz=[ [0,2*hvs], [-hvs/2+cd/2,hvs+2*s], [hvs/2-cd/2,hvs+2*s] ]) | 45 | for(yz=[ [0,z2], [-hvs/2+cd/2,z1], [hvs/2-cd/2,z1] ]) |
45 | translate([0,yz[0],yz[1]]) | 46 | translate([0,yz[0],yz[1]]) |
46 | rotate([0,90,0]) cylinder(d=cd,h=s,$fn=60,center=true); | 47 | rotate([0,90,0]) cylinder(d=cd,h=s,$fn=60,center=true); |
47 | } | 48 | } |
48 | translate([0,0,2*hvs]) sphere(d=2*s,$fn=30); | 49 | translate([0,0,z2]) sphere(d=2*s,$fn=30); |
49 | }else if(what=="altogethernow") { | 50 | }else if(what=="altogethernow") { |
50 | mixing(volume=volume,what="vessel"); | 51 | mixing(volume=volume,what="vessel"); |
51 | translate([0,0,s]) mixing(volume=volume,what="splitter"); | 52 | translate([0,0,s]) mixing(volume=volume,what="splitter"); |