mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
refactor
This commit is contained in:
@@ -28,15 +28,11 @@ function mz_hamiltonian(rows, columns, start = [0, 0], init_cells, seed) =
|
|||||||
all = concat(
|
all = concat(
|
||||||
[
|
[
|
||||||
for(cell = cells)
|
for(cell = cells)
|
||||||
let(
|
let(type = mz_square_get(cell, "t"))
|
||||||
x = cell.x,
|
each if(type == "TOP_WALL") _mz_hamiltonian_top(cell.x, cell.y) else
|
||||||
y = cell.y,
|
if(type == "RIGHT_WALL") _mz_hamiltonian_right(cell.x, cell.y) else
|
||||||
type = mz_square_get(cell, "t")
|
if(type == "TOP_RIGHT_WALL") _mz_hamiltonian_top_right(cell.x, cell.y) else
|
||||||
)
|
if(type == "MASK") _mz_hamiltonian_mask(cell.x, cell.y)
|
||||||
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)
|
|
||||||
|
|
||||||
],
|
],
|
||||||
[for(x = [0:c * 2 - 1]) [x, 0]],
|
[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"))
|
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);
|
Reference in New Issue
Block a user