1w = 3; //mm
 2h = 20; //mm
 3E = 40; //mm
 4n = 20;
 5
 6tolerance = 1; //mm
 7
 8theta = 2*atan(w/(2*h));
 9alpha = n/2*theta;
10
11R = sqrt(h^2+w^2/4);
12
13L = 2*R*sin(alpha)-tolerance;
14P = R*cos(alpha);
15
16module comb(){
17    union(){
18for ( i = [0 : n-1] ){
19rotate([0,0,-alpha+theta*i+theta/2]) translate([-w/2,0,0]) cube([w,h,L],false);
20}
21}
22    }
23
24difference(){
25translate([-L/2,0,0]) cube([L,E,L],false);
26    translate([0,-P,0])
27comb();
28    translate([0,0,L/2]) rotate([0,90,0]) translate([0,0,-L/2]) translate([0,h+E+P-h,0]) 
29    rotate([0,0,180]) comb();
30}
31