N=5; Rout=25; wall_thickness=1; Rc=wall_thickness/2; R0=(Rout-Rc)/2; A=(Rout-Rc)/2; module ear() { translate([0,0,2*Rout+1]) multmatrix([[ 1, 0, 0, 0], [ 0, 0, 1, 0], [ 0,-1, 0, 0], [ 0, 0, 0, 1]]) rotate_extrude($fn=72) translate([2,0,0]) circle(1); } function offset(f) = (R0+A*cos(N*f))*[cos(f), sin(f), 0]; union() { intersection() { linear_extrude(height=2*Rout) union() { for (i=[1:360]) hull() { translate(offset(i-1)) circle(Rc,$fn=72); translate(offset( i )) circle(Rc,$fn=72); } } translate([0,0,Rout]) sphere(Rout,$fn=144); } ear(); }