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

refactor: each

This commit is contained in:
Justin Lin
2022-04-17 10:35:22 +08:00
parent 3e2d95e387
commit d3e1cfea97

View File

@@ -86,13 +86,21 @@ function _replaceStatesAt(wf, x, y, states) =
rowY = eigenstates[y],
leng_rowY = len(rowY),
leng_eigenstates = len(eigenstates),
newRowY = [for(i = 0; i < leng_rowY; i = i + 1) i == x ? states : rowY[i]]
newRowY = [
each [for(i = 0; i < x; i = i + 1) rowY[i]],
states,
each [for(i = x + 1; i < leng_rowY; i = i + 1) rowY[i]]
]
)
[
wf_width(wf),
wf_height(wf),
wf_weights(wf),
[for(i = 0; i < leng_eigenstates; i = i + 1) i == y ? newRowY : eigenstates[i]]
[
each [for(i = 0; i < y; i = i + 1) eigenstates[i]],
newRowY,
each [for(i = y + 1; i < leng_eigenstates; i = i + 1) eigenstates[i]]
]
];
function wf_not_collapsed_coords(wf, notCollaspedCoords) =