From 1072876ac746d87db83ae05bd73eda29e69198c4 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sun, 27 Mar 2022 11:49:03 +0800 Subject: [PATCH] refactor: two dim cells --- src/maze/mz_hexwalls.scad | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/maze/mz_hexwalls.scad b/src/maze/mz_hexwalls.scad index b9f5c7ad..3b61cb06 100644 --- a/src/maze/mz_hexwalls.scad +++ b/src/maze/mz_hexwalls.scad @@ -9,15 +9,14 @@ **/ use <_impl/_mz_hex_walls.scad>; -use <../util/find_index.scad>; function mz_hexwalls(cells, cell_radius, left_border = true, bottom_border = true) = let( - columns = find_index(cells, function(cell) cell.y != 0), - rows = len(cells) / columns + rows = len(cells), + columns = len(cells[0]) ) [ - each [for(cell = cells, wall = _build_cell(cell_radius, cell)) wall], + each [for(row = cells, cell = row, wall = _build_cell(cell_radius, cell)) wall], if(left_border) each [ for(y = [0:rows - 1])