Brian, it would be great if you included a working example in the
default tab. The following example has amused me for nearly 15
minutes now:
: function main() {
: var demo = 3;
:
: var resolution = 24; // increase to get smoother corners (will get slow!)
: var data;
:
: if (demo == 1) {
: data = CSG.cube({center: [0,0,0], radius: [10,10,10]});
: } else if (demo == 2) {
: data = CSG.sphere({center: [0,0,0], radius: 10});
: } else {
: var a = CSG.cube({radius: [10, 10, 10]});
: var b = CSG.sphere({ radius: 13.5, stacks: 12 });
: var c = CSG.cylinder({ radius: 7, start: [-10, 0, 0], end:
[10, 0, 0] });
: var d = CSG.cylinder({ radius: 7, start: [0, -10, 0], end:
[0, 10, 0] });
: var e = CSG.cylinder({ radius: 7, start: [0, 0, -10], end:
[0, 0, 10] });
: data = a.intersect(b).subtract(c.union(d).union(e));
: }
: return data;
: }