From 843e03ce18082a0b5ad6601ea1025e4a28995af5 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 23 Apr 2021 07:52:38 +0800 Subject: [PATCH] performance improved --- src/experimental/_impl/_tiles_wfc_impl.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/experimental/_impl/_tiles_wfc_impl.scad b/src/experimental/_impl/_tiles_wfc_impl.scad index 8bce69c5..ffe9a3b7 100644 --- a/src/experimental/_impl/_tiles_wfc_impl.scad +++ b/src/experimental/_impl/_tiles_wfc_impl.scad @@ -16,7 +16,7 @@ function weights_of_tiles(sample) = let( symbols = flat(sample), leng = len(symbols), - weights = hashmap(number_of_buckets = sqrt(leng)) + weights = hashmap(number_of_buckets = leng) ) _weights_of_tiles(weights, symbols, leng); @@ -284,7 +284,7 @@ function compatibilities_of_tiles(sample) = for(x = [0:width - 1]) for(c = neighbor_compatibilities(sample, x, y, width, height)) c - ]); + ], number_of_buckets = width * height); function collapsed_tiles(wf) = let(