1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 01:34:12 +02:00

refactored

This commit is contained in:
Justin Lin
2017-05-29 17:28:23 +08:00
parent b03c8b4a5d
commit a325eb7f4d

View File

@@ -17,6 +17,7 @@ module hexagons(radius, spacing, levels) {
offset_y = radius + radius * sin(30);
r_hexagon = radius - spacing / 2;
offset_step = 2 * offset_x;
center_offset = [2 * (offset_x - offset_x * levels) , 0, 0];
module hexagon() {
rotate(30)
@@ -24,15 +25,13 @@ module hexagons(radius, spacing, levels) {
}
module line_hexagons(n) {
for(i = [0:n - 1]) {
translate(center_offset) for(i = [0:n - 1]) {
offset_p = [i * offset_step, 0, 0];
translate(offset_p)
hexagon();
}
}
translate([2 * (offset_x - offset_x * levels) , 0, 0])
union() {
line_hexagons(beginning_n);
if(levels > 1) {
@@ -48,4 +47,3 @@ module hexagons(radius, spacing, levels) {
}
}
}
}