Created
March 23, 2020 17:18
-
-
Save creationix/e85ba7790c6f3722a4d4011a23c1f414 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = cos(60); | |
b = sin(60); | |
z = 0.25; // inset to connections, larger is looser. 0.2 | |
w = 7; | |
hex_tile = [ | |
[(-1+z)*a,(2*w-1-z)*b], | |
[w+(-1-z)*a,(2*w-1-z)*b], | |
[w+(-2)*a,(2*w-2)*b], | |
[w-z-1+(-2)*a,(2*w-2)*b], | |
[w-1+(w-2-z)*a,(w-2-z)*b], | |
[(w-1)+(w-z)*a,(w-z)*b], | |
[(w-1)-z+(2*w)*a,0], | |
[(w-2)+(2*w)*a,0], | |
[w-2+(2*w-1-z)*a,(1+z)*b], | |
[w-2-z+(w-1)*a,(-w+1)*b], | |
[w-z+(w-1)*a,(-w+1)*b], | |
[w-(1+z)*a,(-2*w+1+z)*b], | |
[w-2*a,(-2*w+2)*b], | |
[w-(1-z)*a,(-2*w+3+z)*b], | |
[-(1+z)*a,(-2*w+3+z)*b], | |
[+(1-z)*a,(-2*w+1+z)*b], | |
[-w+(1+z)*a,(-2*w+1+z)*b], | |
[2*a-w,(-2*w+2)*b], | |
[-w+1+z+(2)*a,-(2*w-2)*b], | |
[-w+1-(w-2-z)*a,-(w-2-z)*b], | |
[-w+1-(w-z)*a,-(w-z)*b], | |
[-w+1+z-(2*w)*a,0], | |
[-w+2-(2*w)*a,0], | |
[-w+2-(2*w-1-z)*a,-(1+z)*b], | |
[-w+2+z-(w-1)*a,(w-1)*b], | |
[-w+z+(-w+1)*a,(w-1)*b], | |
[-w+(1+z)*a,(2*w-1-z)*b], | |
[-w+2*a,(2*w-2)*b], | |
[-w+(1-z)*a,(2*w-3-z)*b], | |
[(1+z)*a,(2*w-3-z)*b] | |
]; | |
union() { | |
difference() { | |
scale([1.5,1.5]) linear_extrude(height = 3, convexity = 200) { | |
polygon(hex_tile); | |
} | |
translate([0,0,1]) linear_extrude(height=3) | |
circle(15.25,$fn=6); | |
translate([0,0,-2]) linear_extrude(height=4) | |
circle(12,$fn=6); | |
} | |
/* | |
r = 0.7; | |
linear_extrude(height=0.5) { | |
for (i = [-5:2:5]) { | |
translate([1+a,i*b]) circle(r,$fn=6); | |
translate([-1-a,i*b]) circle(r,$fn=6); | |
} | |
for (i = [-4:2:4]) { | |
translate([0,i*b]) circle(r,$fn=6); | |
translate([-2-2*a,i*b]) circle(r,$fn=6); | |
translate([2+2*a,i*b]) circle(r,$fn=6); | |
} | |
for (i = [-1:2:1]) { | |
translate([-3-3*a,i*b]) circle(r,$fn=6); | |
translate([+3+3*a,i*b]) circle(r,$fn=6); | |
} | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment