1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
This commit is contained in:
Justin Lin 2022-05-07 17:02:11 +08:00
parent 6b353cb7a5
commit c513d0753c

View File

@ -48,16 +48,14 @@ function _bspline_curve_interpolate(t, degree, points, knots, weights) =
wts = is_undef(weights) ? _bspline_curve_weights(n) : weights, wts = is_undef(weights) ? _bspline_curve_weights(n) : weights,
v = [ v = [
for(i = 0; i < n; i = i + 1) for(i = 0; i < n; i = i + 1)
let(p = points[i] * wts[i]) let(wt = wts[i])
[each [for(j = 0; j < d; j = j + 1) p[j]], wts[i]] [each points[i] * wt, wt]
], ],
ts = _bspline_curve_ts(t, degree, kts), ts = _bspline_curve_ts(t, degree, kts),
s = ts[1], s = ts[1],
nv = _bspline_curve_v(v, s, ts[0], degree, kts, d), nvs = _bspline_curve_v(v, s, ts[0], degree, kts, d)[s]
nvs = nv[s],
nvsd = nvs[d]
) )
[for(i = 0; i < d; i = i + 1) nvs[i] / nvsd]; [for(i = 0; i < d; i = i + 1) nvs[i]] / nvs[d];
function _bspline_curve_impl(t_step, degree, points, knots, weights) = function _bspline_curve_impl(t_step, degree, points, knots, weights) =
let(n = len(points)) let(n = len(points))