MokaFiller/mokaFiller.scad

146 lines
3.5 KiB
OpenSCAD

include <BOSL2/std.scad>
include <BOSL2/threading.scad>
include <BOSL2/rounding.scad>
//include <lib/auger_screw.scad>
/*[Top Settings]*/
effective_diameter = 73.3;
diameter = 75; // 75 fit
// Interal of the
internal_diameter = 60;
thickness = 2;
wall = 3;
tap_height = 2;
base_thickness = 5;
filler_height = 10;
flattener_tickness = 3; // 2 small
radius = diameter/2;
/*[Rendering]*/
part_rendering = "All"; // [All,Base,Flattener]
printable = true;
version = "0.1b";
/*[Hidden]*/
$fn = 64;
OFFSET = 0.01;
CLEARING = 0.1;
//cube([5,5,5],anchor=BOTTOM);
// Base Tube on moka screw
if (part_rendering == "All")
mokaFiller();
else if (part_rendering == "Flattener")
//mirror([0,0,printable ? -1 : 0])
yrot(printable ? 180 : 0 )
flattener(filler_height,diameter=internal_diameter,wall=flattener_tickness);
else if (part_rendering == "Base") {
difference() {
mokaFiller( flattener = false);
flattener(filler_height,diameter=internal_diameter,wall=flattener_tickness+CLEARING);
}
}
module mokaFiller(flattener = true) {
baseHeight = base_thickness + tap_height;
//left(60)
down( base_thickness )
/*back_half() */
diff() cyl(h=baseHeight,d=diameter+2*wall,rounding2=1,anchor=BOTTOM ) {
color("Blue")
attach(TOP,TOP,inside=true,shiftout=0.1)
tag("remove")
cyl(d=internal_diameter,h=baseHeight,anchor=TOP);
color("Red")
attach(BOTTOM,BOTTOM,inside=true,shiftout=0.1)
//tag("remove")
cyl(d=diameter,h=base_thickness);
attach(TOP,BOTTOM) {
if (flattener) flattener(10,diameter=internal_diameter,wall=2);
cone(10);
};
};
}
module flattener(height=10,diameter,offset=10,wall=3) {
radius= diameter/2
//+ offset/2
;
poly = [[0,0], [radius+offset,0], [radius+offset,wall], [0,wall]/*, [0,-30]*/];
//polygon(poly) ;
//up(wall/2)
intersection()
{
color ("Orange")
spiral_sweep(poly, h=height*0.85,
r1=1,
r2=1,
turns=0.4,
//lead_in=-1,
lead_in1 = -1,
lead_in2 = -0.5,
lead_in_shape="sqrt",
$fn=128,
anchor=BOTTOM
);
if (true) down(3) color ("Red") cyl(h=height*2,d1=diameter,d2=diameter+1.9*offset+wall);
};
}
module cone(height = 10,wall = 2) {
//back_half()
tube(
h=height,
id1=internal_diameter,
id2 = internal_diameter+10,
wall=wall,
rounding1=-1.2,
rounding2=1
);
}
module gabarit() {
down(10) color ("Orange") circle(d=diameter);;
down(5) color ("Red") circle(d=internal_diameter);;
}
function getFilename(part_rendering) =
part_rendering == "All" ? "moka-filler" :
part_rendering == "Flattener" ? "moka-filler-flattener" :
part_rendering == "Base" ? "moka-filler-base" :
"???";
echo ("***************************");
echo (str("version : ",getFilename(part_rendering),"-",version,".stl "));
echo ("***************************");
//left(50)
//color ("Red") up (80/2) spiral_sweep(poly, h=10, r1=2,r2=30, turns=0.3, $fn=36);