1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-23 14:54:12 +02:00

refactor: conditional value

This commit is contained in:
Justin Lin
2022-03-24 22:30:12 +08:00
parent 438e7752ac
commit 6292c8989a

View File

@@ -38,12 +38,12 @@ function mz_wang_tiles(cells, left_border = true, bottom_border = true) =
bottom_border ? [for(x = [0:columns - 1]) [x * 2 + 1, 0]] : [
for(x = [0:columns - 1])
let(type = mz_square_get(top_cells[x], "t"))
if(type == "RIGHT_WALL" || type == "NO_WALL") [x * 2 + 1, 1] else [x * 2 + 1, 0]
[x * 2 + 1, type == "RIGHT_WALL" || type == "NO_WALL" ? 1 : 0]
],
left_border ? [for(y = [0:rows - 1]) [0, y * 2 + 1]] : [
for(y = [0:rows - 1])
let(type = mz_square_get(right_cells[y], "t"))
if(type == "TOP_WALL" || type == "NO_WALL") [1, y * 2 + 1] else [0, y * 2 + 1]
[type == "TOP_WALL" || type == "NO_WALL" ? 1 : 0, y * 2 + 1]
]
),
dot_pts = sort(hashset_elems(hashset(all, hash = function(p) _pt2_hash(p))), by = "vt")