the number of Gauss-Legendre Quadrature points to use for arc length approximation
the number of arc length samples to use to fit an inverse function for calculating t from arc length
Optional
onInvalidateCache: (() => void)callback function to be invoked when cache is invalidated
Curve alpha parameter (0=uniform, 0.5=centripetal, 1=chordal)
Determines whether the curve should be a closed curve or not
Curve tension (0=Catmull-rom, 1=linear)
Evaluate curve segment function at t
vector
time along full curve (encodes segment index and segment t)
Optional
target: Vectoroptional target vector
Get the curve function coefficients at the given segment index. The coefficients are calculated once per segment and put in cache until it is invalidated.
coefficients for the curve function at the given segment index
segment index
Get samples for inverse function from cache if present, otherwise calculate and put in cache for re-use.
Lengths, slopes and coefficients for inverse function
curve segment index
Generated using TypeDoc
This curve mapper implementation uses a numerical integration method (Gauss Legendre) in order to approximate curve segment lengths. For re-parameterization of the curve function in terms of arc length, a number of precalculated lengths (samples) is used to fit a monotone piecewise cubic function using the approach suggested here: https://stackoverflow.com/questions/35275073/uniform-discretization-of-bezier-curve