Way to round edges of objects opensCAD
I was looking for a radiused block to 3d print an instrument case. After reading the earlier answers I looked into hull (Not the town! :-) making 8 identical spheres at the corners of a block and hulling them looks good.
module radiusedblock(xlen,ylen,zlen,radius){
hull(){
translate([radius,radius,radius]) sphere(r=radius);
translate([xlen + radius , radius , radius]) sphere(r=radius);
translate([radius , ylen + radius , radius]) sphere(r=radius);
translate([xlen + radius , ylen + radius , radius]) sphere(r=radius);
translate([radius , radius , zlen + radius]) sphere(r=radius);
translate([xlen + radius , radius , zlen + radius]) sphere(r=radius);
translate([radius,ylen + radius,zlen + radius]) sphere(r=radius);
translate([xlen + radius,ylen + radius,zlen + radius]) sphere(r=radius);
}
}
radiusedblock(30,40,50,5);
minkowski()
is your friend for rounding over all edges of a geometry. minkowski()
is also incredibly slow and should only be used for final rendering. You can also implement primitives which have rounded edges more efficiently with other constructs.
$fn=60;
module drawLedgeRing()
{
difference()
{
cylinder(4,10,10);
translate([0,0,-1])
cylinder(4,6,6);
translate([0,0,2])
cylinder(4,8,8);
}
}
minkowski()
{
drawLedgeRing();
sphere(.25);
}
//drawLedgeRing();
There are probably many ways to make a rounded cylinder. One way is to make 2 donut shaped objects and hull them
hull(){
rotate_extrude() translate([r1,0,0]) circle(r2);
rotate_extrude() translate([r1,0,h1]) circle(r2);
}