1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00
This commit is contained in:
Justin Lin
2022-05-07 16:47:44 +08:00
parent 916f833107
commit 6b353cb7a5

View File

@@ -21,18 +21,17 @@ function _bspline_curve_alpha(i, l, t, degree, knots) =
function _bspline_curve_nvi(v, i, l, t, degree, knots, d) = function _bspline_curve_nvi(v, i, l, t, degree, knots, d) =
let(alpha = _bspline_curve_alpha(i, l, t, degree, knots)) let(alpha = _bspline_curve_alpha(i, l, t, degree, knots))
[[for(j = 0; j < d + 1; j = j + 1) ((1 - alpha) * v[i - 1][j] + alpha * v[i][j])]]; [for(j = 0; j < d + 1; j = j + 1) ((1 - alpha) * v[i - 1][j] + alpha * v[i][j])];
function _bspline_curve_nvl(v, l, s, t, degree, knots, d, i) = function _bspline_curve_nvl(v, l, s, t, degree, knots, d, i) =
i == (s - degree - 1 + l) ? v : i == (s - degree - 1 + l) ? v :
let( let(
leng_v = len(v), leng_v = len(v),
nvi = _bspline_curve_nvi(v, i, l, t, degree, knots, d), nv = [
nv = concat( each [for(j = 0; j < i; j = j + 1) v[j]],
[for(j = 0; j < i; j = j + 1) v[j]], _bspline_curve_nvi(v, i, l, t, degree, knots, d),
nvi, each [for(j = i + 1; j < leng_v; j = j + 1) v[j]]
[for(j = i + 1; j < leng_v; j = j + 1) v[j]] ]
)
) )
_bspline_curve_nvl(nv, l, s, t, degree, knots, d, i - 1); _bspline_curve_nvl(nv, l, s, t, degree, knots, d, i - 1);