I was needing to figure this out myself. The only thing you are missing is the blending command after doing the union of the rounded cubes.
var uiParams = [
{
name: "blend",
label: "blend",
desc: "blend",
type: "double",
rangeMin: 0.1,
rangeMax: 20,
step: 0.1,
defaultVal: 2,
unit: "MM",
group: "Size"
},
{
name: "round",
label: "round",
desc: "round",
type: "double",
rangeMin: 0.1,
rangeMax: 20,
step: 0.1,
defaultVal: 2,
unit: "MM",
group: "Size"
}
];
function main(args) {
var box1 = new Box(10*MM, 10*MM, 10*MM);
box1.setRounding(args.round);
var box2 = new Box(10*MM, 10*MM, 10*MM);
box2.setTransform(new Translation(5*MM, 5*MM, 5*MM));
box2.setRounding(args.round);
var union1 = new Union(box1, box2);
union1.setBlend(args.blend);
var s = 20 * MM;
return new Scene(union1, new Bounds(-s,s,-s,s,-s,s));
}