diff --git a/src/experimental/_impl/_tiles_wfc_impl.scad b/src/experimental/_impl/_tiles_wfc_impl.scad index c5f7e59f..8a407196 100644 --- a/src/experimental/_impl/_tiles_wfc_impl.scad +++ b/src/experimental/_impl/_tiles_wfc_impl.scad @@ -79,12 +79,10 @@ function _wf_collapse(wf, x, y, states_weights, leng, threshold, i = 0) = threshold < 0 || i == leng ? wf : let(state_weight = states_weights[i]) _wf_collapse( - threshold < state_weight[1] ? _oneStateAt(wf, x, y, state_weight[0]) : wf, + threshold < state_weight[1] ? _replaceStatesAt(wf, x, y, [state_weight[0]]) : wf, x, y, states_weights, leng, threshold - state_weight[1], i + 1 ); -function _oneStateAt(wf, x, y, state) = _replaceStatesAt(wf, x, y, [state]); - // Shannon entropy function wf_entropy(wf, x, y) = let(