author | Michael Krelin <hacker@klever.net> | 2016-06-19 21:42:02 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-06-19 21:42:02 (UTC) |
commit | b058fc56422523d643e0e30250102fdbae8ea69b (patch) (side-by-side diff) | |
tree | f9fd22db839e211ed2a59f6e143f361a5e161487 | |
download | hotendery-b058fc56422523d643e0e30250102fdbae8ea69b.zip hotendery-b058fc56422523d643e0e30250102fdbae8ea69b.tar.gz hotendery-b058fc56422523d643e0e30250102fdbae8ea69b.tar.bz2 |
mixing vessel
-rw-r--r-- | mixing.scad | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/mixing.scad b/mixing.scad new file mode 100644 index 0000000..ecbdfd8 --- a/dev/null +++ b/mixing.scad @@ -0,0 +1,56 @@ +s=2; /* shell thickness */ +defaultvolume=20*10*20; /* volume for testing */ + +/* side of the cube, containing half the volume */ +function mixing_hvs(volume=defaultvolume) = pow(volume/2,1/3); +/* vessel dimensions */ +function mixing_size(volume=defaultvolume) = let(hvs = mixing_hvs(volume=volume)) [2*hvs+3*s,hvs+2*s,hvs+2*s]; + +module mixing( + volume=defaultvolume, /* volume in cubic mm */ + what="altogethernow" /* vessel|splitter|altogethernow */ +) { + g=1; /* guide diameter */ + hvs = mixing_hvs(volume=volume); + if(what=="vessel") { + sz = mixing_size(volume=volume); + translate([-sz[0]/2,-sz[1]/2,0]) difference() { + cube(size=sz); + translate([s,s,s]) + cube(size=[2*hvs+s,hvs,hvs+s+1]); + } + for(mx=[0,1]) mirror([mx,0,0]) { + // horizontal guide + translate([s/2+g/2,0,s]) rotate([90,0,0]) cylinder(d=g,h=hvs+s,center=true,$fn=12); + for(my=[0,1]) mirror([0,my,0]) { + // vertical guide + crowning sphere + translate([s/2+g/2,hvs/2,0]) { + cylinder(d=g,h=hvs+2*s-g/2,$fn=12); + translate([0,0,s+hvs+s-g/2]) sphere(d=g,$fn=12); + } + } + // level + translate([0,0,s+hvs]) { + translate([s/2+hvs,0,0]) rotate([90,0,0]) cylinder(d=g,h=hvs+s,center=true,$fn=12); + for(my=[0,1]) mirror([0,my,0]) { + translate([s/2+g/2,hvs/2,0]) rotate([0,90,0]) cylinder(d=g,h=hvs-g/2+s/2,$fn=12); + } + } + } + }else if(what=="splitter") { + hull() { + translate([-s/2,-hvs/2,0]) cube(size=[s,hvs,hvs+2*s]); + cd=hvs/2; + for(yz=[ [0,2*hvs], [-hvs/2+cd/2,hvs+2*s], [hvs/2-cd/2,hvs+2*s] ]) + translate([0,yz[0],yz[1]]) + rotate([0,90,0]) cylinder(d=cd,h=s,$fn=60,center=true); + } + translate([0,0,2*hvs]) sphere(d=2*s,$fn=30); + }else if(what=="altogethernow") { + mixing(volume=volume,what="vessel"); + translate([0,0,s]) mixing(volume=volume,what="splitter"); + } +} + +color("salmon",0.7) mixing(what="altogethernow"); +/* vim:set ai sw=1: */ |