1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-09 08:16:50 +02:00

refactor: two dim cells

This commit is contained in:
Justin Lin
2022-03-27 11:49:03 +08:00
parent a5408736e5
commit 1072876ac7

View File

@@ -9,15 +9,14 @@
**/ **/
use <_impl/_mz_hex_walls.scad>; use <_impl/_mz_hex_walls.scad>;
use <../util/find_index.scad>;
function mz_hexwalls(cells, cell_radius, left_border = true, bottom_border = true) = function mz_hexwalls(cells, cell_radius, left_border = true, bottom_border = true) =
let( let(
columns = find_index(cells, function(cell) cell.y != 0), rows = len(cells),
rows = len(cells) / columns 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 [ if(left_border) each [
for(y = [0:rows - 1]) for(y = [0:rows - 1])