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

add seed param

This commit is contained in:
Justin Lin
2021-01-23 22:33:49 +08:00
parent 917f8f79f1
commit 9850f019db

View File

@@ -1,9 +1,17 @@
module 2_edge_wang_tiles(rows, columns, tile_width) {
edges = [
module 2_edge_wang_tiles(rows, columns, tile_width, seed) {
edges = is_undef(seed) ? [
for(y = [0:rows])
[
for(x = [0:columns])
[round(rands(0, 1, 1)[0]), round(rands(0, 1, 1)[0])]
let(rs = rands(0, 1, 2))
[round(rs[0]), round(rs[1])]
]
] : [
for(y = [0:rows])
[
for(x = [0:columns])
let(rs = rands(0, 1, 2, 10 + y * columns + x))
[round(rs[0]), round(rs[1])]
]
];