mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-27 10:15:05 +02:00
t-value control
This commit is contained in:
@@ -159,12 +159,20 @@ function computeBestFit(P, M, S, n) {
|
||||
}
|
||||
|
||||
function fit(points, mode) {
|
||||
// mode could be an int index to fit.modes, below,
|
||||
// which are used to abstract time values, OR it
|
||||
// could be a prespecified array of time values to
|
||||
// be used in the final curve fitting step.
|
||||
var TS;
|
||||
if (mode instanceof Array) {
|
||||
TS = mode;
|
||||
mode = false;
|
||||
}
|
||||
mode = mode || 0;
|
||||
console.log("mode: ", mode);
|
||||
var n = points.length,
|
||||
P = Array.from(points),
|
||||
M = computeBasisMatrix(n),
|
||||
S = computeTimeValues[fit.modes[mode]](P, n),
|
||||
S = TS || computeTimeValues[fit.modes[mode]](P, n),
|
||||
C = computeBestFit(P, M, S, n);
|
||||
return { n, P, M, S, C };
|
||||
}
|
||||
|
Reference in New Issue
Block a user