1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 17:54:18 +02:00
This commit is contained in:
Justin Lin
2022-03-16 07:59:41 +08:00
parent cb0e361671
commit a93739474b

View File

@@ -12,8 +12,17 @@ use <_impl/_mz_square_cells_impl.scad>;
use <mz_square_initialize.scad>;
function mz_square_cells(rows, columns, start = [0, 0], init_cells, x_wrapping = false, y_wrapping = false, seed) =
let(
init_undef = is_undef(init_cells),
mz = init_undef ? mz_square_initialize(rows, columns) : init_cells,
rc = init_undef ? [rows, columns] : [len([for(cell = mz) if(cell.y == 0) undef]), len([for(cell = mz) if(cell.x == 0) undef])]
)
go_maze(
start.x, start.y,
is_undef(init_cells) ? mz_square_initialize(rows, columns) : init_cells,
rows, columns, x_wrapping, y_wrapping, seed
start.x,
start.y,
mz,
rc[0], rc[1],
x_wrapping,
y_wrapping,
seed
);