Closed marcoqu closed 1 year ago
Wait, maybe I got it. Can I do it like this?
var ctrlPoints = [[0,0], [2,3], [7,9], [8,12]]
var c = new CurveInterpolator(ctrlPoints)
var Ts = ctrlPoints.map((_, i) => i / (ctrlPoints.length - 1));
var Us = Ts.map(t => getTtoUmapping(t, c.arcLengths));
Your assumption is correct - closing this.
In version 3.1.0 there's now a convenience method for getting the position (u) or time (u) given the index of a control point.
.getPositionAtKnot(u) .getTimeAtKnot(t)
Hi Kjerand, very nice library. Thank you. I was wondering if there is any way to get the position (T, or U) of the control points used to create the curve itself. If I create a curve
new CurveInterpolator([[0,0], [2,3], [7,9], [8,12]])
can I get the position on curve (0 - 1) of point[2,3]
?Thanks!