/* create a hexagon (a circle with $fn=6) with value c circumdiameter the wall thickness is based on the indiameter in = 2* sqrt((c*0.5*c*0.5) -(c*0.25*c*0.25)) arrange hexagons with wall thickness between them y (vertical) spacing will be in + th the x (horizontal spacing will be c+ (th*f) (f is a factor... subtract pattern from shape add frame extrude */ fw = 5; //frame width fh = 12; // frame height c = 10; // circumdiameter of hexagon th = 1; // wall thickness x = 100; // width of pattern and frame y = 60; // height of pattern and frame in = 2* sqrt((c*0.5*c*0.5) -(c*0.25*c*0.25)); //inner diameter module hex(){ circle(d=c,$fn=6); } module fill(){ yt = y/(in+th); // number of y iterations h = sqrt((th*th)-(th/2*th/2)); // h is hypotenuse of thickness ptp = (c/2)+(2*h); // x distance between points st = sin(60)*th; // small triangle of thickness xt = x/( ptp+c); // number of x iterations o=c/4+c/2+st; // offset in x direction for odd columns for ( k = [0:1:xt+1]){ for ( j = [0:1:yt]){ translate([k*(ptp+c),j*(in+th),0]) hex(); // even columns translate([k*(ptp+c)+o,j*(in+th)+(in+th)/2,0]) hex(); } } } module pattern(){ difference (){ square([x,y]); fill(); } } module frame(){ difference(){ square([x,y]); translate([fw,fw,0]) square([x-fw-fw,y-fw-fw]); } } linear_extrude(fh){ frame(); pattern(); }