Skip to main content

Adding Fillets

Next we're going to learn about a hack that every OpenSCAD coder should know, and that is you can create fillets with offset. Fillets are often ignored in OpenSCAD because they can be difficult to do, but you're not going to ignore them because you're a good engineer. We need to give fillets their due because they play an important role in reducing stress concentrations, have you ever seen an airplane with sharp square windows?? Exactly!

Offset#

Offset works by "expanding" the skin of your 2d shape but importantly it rounds external corners in the process. See our swole hinge profile below:

// ... variables above
offset(1){
translate([0,pivotRadius,0]){
circle(pivotRadius);
}
square([pivotRadius,pivotRadius]);
translate([pivotRadius,0,0]){
square([baseWidth,baseThickness]);
}
}

Live Demo

Double Offset#

Here's the rub, we can do this again in reverse using a negative number to bring us back to our original dimensions but with an internal fillet.

offset(-1)offset(1){
// ... hinge profile
}

Live Demo

Triple Offset#

It gets even better, we can double our negative value and apply a third offset to get external fillets as well, to better understand what's happening here let's overlay the shapes after each offset.

In essence we over expand, then under expand before finally expanding back to the original dimensions, but we have gained fillets in the process, it's like kneading bread, the more you do it the better the bread . . . not really stick to 3 max.

offset(1)offset(-2)offset(1){
// ... hinge profile
}

Live Demo