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

refactor: don't each

This commit is contained in:
Justin Lin
2022-05-08 11:00:59 +08:00
parent cd84c11213
commit bd34a907c2

View File

@@ -6,11 +6,8 @@ function _lsystem2_join(str_lt) = _join(str_lt);
function _lsystem2_derive(axiom, rules, n, rule_prs, seed) = _derive(axiom, rules, n, rule_prs, seed); function _lsystem2_derive(axiom, rules, n, rule_prs, seed) = _derive(axiom, rules, n, rule_prs, seed);
function _next_stack(t, code, stack) = function _next_stack(t, code, stack) =
code == "[" ? [t, each stack] : code == "[" ? [t, stack] :
let(leng = len(stack)) code == "]" && stack != [] ? stack[1] : stack;
code == "]" ?
(leng > 1 ? [for(i = [1:leng - 1]) stack[i]] : []) :
stack;
function _next_t1(t1, t2, code, stack) = function _next_t1(t1, t2, code, stack) =
code == "[" ? t1 : code == "[" ? t1 :