BOSL2 can help with that:

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad

https://github.com/BelfrySCAD/BOSL2/wiki/Tutorial-Rounding_t...