1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 13:31:30 +02:00
This commit is contained in:
Justin Lin
2022-03-17 16:28:04 +08:00
parent 4b24c81eeb
commit 4a5c576630

View File

@@ -28,15 +28,11 @@ function mz_hamiltonian(rows, columns, start = [0, 0], init_cells, seed) =
all = concat(
[
for(cell = cells)
let(
x = cell.x,
y = cell.y,
type = mz_square_get(cell, "t")
)
each if(type == "TOP_WALL") _mz_hamiltonian_top(x, y) else
if(type == "RIGHT_WALL") _mz_hamiltonian_right(x, y) else
if(type == "TOP_RIGHT_WALL") _mz_hamiltonian_top_right(x, y) else
if(type == "MASK") _mz_hamiltonian_mask(x, y)
let(type = mz_square_get(cell, "t"))
each if(type == "TOP_WALL") _mz_hamiltonian_top(cell.x, cell.y) else
if(type == "RIGHT_WALL") _mz_hamiltonian_right(cell.x, cell.y) else
if(type == "TOP_RIGHT_WALL") _mz_hamiltonian_top_right(cell.x, cell.y) else
if(type == "MASK") _mz_hamiltonian_mask(cell.x, cell.y)
],
[for(x = [0:c * 2 - 1]) [x, 0]],
@@ -44,4 +40,4 @@ function mz_hamiltonian(rows, columns, start = [0, 0], init_cells, seed) =
),
dot_pts = dedup(sort(all, by = "vt"))
)
_mz_hamiltonian_travel(dot_pts, start * 3, r * c * 4);
_mz_hamiltonian_travel(dot_pts, start * 2, r * c * 4);