I've used it to create some parametric stuff (an alternative layout piano keyboard), it's super powerful.
Here is an example:
module slice(r = 10, deg = 30) {
degn = (deg % 360 > 0) ? deg % 360 : deg % 360 + 360;
difference() {
circle(r, $fn=100);
if (degn > 180) intersection_for(a = [0, 180 - degn]) rotate(a) translate([-r, 0, 0]) square(r * 2);
else union() for(a = [0, 180 - degn]) rotate(a) translate([-r, 0, 0]) square(r * 2);
}
}
module 3d_slice(height, r, deg) {
linear_extrude(height = height) slice(r, deg);
}
module key(c, n, l, padlength, a) {
padangle = 6;
// support
color("brown") render() rotate([90,0,0]) translate ([0,0,13 * n]) difference() { 3d_slice(12, l, a); 3d_slice(12,l-(padlength-3),a+0.1); };
// keypad
color(c) render() rotate([90,0,0]) translate ([0,0,-6 + 13 * n]) difference() { 3d_slice(24, l, a+padangle); 3d_slice(24,l-(padlength-3),a+padangle+0.1); 3d_slice(24, l, a);};
}
module note(n) {
colors = ["red", "black", "white", "black", "white", "white", "black", "white", "black", "white", "black", "white"];
tone = n % 12;
// angles just below the keypad
aa = 3.5;
ab = 6; // this one is important, too small and you won't be able to press the key all the way down
ac = 8.25;
ad = 10;
hingeoffset = 6;
keypad = 30;
length = 225;
width = 12;
height = 12;
space = 1;
xlat = (width + space) * n;
if ((n % 2) == 1) {
l = length - keypad + hingeoffset;
color("brown") render() rotate([90,0,0]) translate ([-6,-hingeoffset,xlat]) cube([l,width,height]);
key(colors[tone], n, length-3*keypad, keypad, ad);
key(colors[tone], n, length-keypad, keypad, ab);
}
else {
// long keys
l = length + hingeoffset;
// base
color("brown") render() rotate([90,0,0]) translate ([-6,-hingeoffset,xlat]) cube([l,width,height]);
// inner key
key(colors[tone], n, length-2*keypad, keypad, ac);
// outer key
key(colors[tone], n, length, keypad, aa);
}
}
for (i=[0:60]) {
note(i);
}