From 5fa543fcab0e4160b6aed62e95c852b2cb8634b8 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 29 May 2017 18:36:55 +0800 Subject: [PATCH] refactored --- src/hexagons.scad | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/hexagons.scad b/src/hexagons.scad index d5b9de7a..97827635 100644 --- a/src/hexagons.scad +++ b/src/hexagons.scad @@ -32,7 +32,7 @@ module hexagons(radius, spacing, levels) { offset_xs = [for(i = [0:n - 1]) i * offset_step + center_offset] ) [ - for(x = offset_xs) [x + tx, ty, 0] + for(x = offset_xs) [x + tx, ty] ]; module line_hexagons(hex_datum) { @@ -70,18 +70,22 @@ module hexagons(radius, spacing, levels) { lower_hex_data ); - for(hex_datum = total_hex_data) { - pts = hexagons_pts(hex_datum); - for(pt = pts) { + pts_all_lines = [ + for(hex_datum = total_hex_data) + hexagons_pts(hex_datum) + ]; + + for(pts_one_line = pts_all_lines) { + for(pt = pts_one_line) { translate(pt) hexagon(); } - - } + + test_each_hexagon(r_hexagon, pts_all_lines); } // override it to test -module test_each_hexagon(hex_r, pts) { +module test_each_hexagon(hex_r, pts_all_lines) { } \ No newline at end of file