-
Notifications
You must be signed in to change notification settings - Fork 8
Description
A BSpline b wraps the actual interpolation b.r, which is parameterized by t ranging between 0 and 1, not by arclength. Some operations with BSplines are relatively slow because b(s) needs to find the value t_s where the arclength integral reaches s. We should probably just precompute interpolations for t_to_arclength and arclength_to_t, or lazily compute them the first time we get an operation that needs to call those a lot. This should also help with issues that occasionally come up with BSpline autodiff trying to go through quadgk or zero-finding.
(Right now we use b.r(t) rather than b(s) in some situations where we're technically making an approximation that assumes the speed ds/dt is nearly constant. It would be slightly nicer not to assume that, although I'd like to see evidence that it matters first. For example, in discretize_curve, we use the second derivative of r rather than the curvature, so the tolerance calculation is only a correct first-order approximation if ds/dt is constant. However even if it matters the preferred solution there might just be to use the curvature. I don't think it ends up that much more expensive.)