Skip to content

Releases: kjerandp/curve-interpolator

Release 2.0.5

27 Apr 20:29
Compare
Choose a tag to compare

Bug fix release

  • Fixes issue #5 (happening when too few control points are provided)

Release 2.0.4

17 Apr 12:31
Compare
Choose a tag to compare
  • Fixed mistake in previous fix in v2.0.3

Release 2.0.3

17 Apr 12:14
Compare
Choose a tag to compare
  • Bugfix when doing lookup and returning last match.
  • Updated dependencies.
  • Updated docs.

Release v2.0.2

16 Mar 19:38
Compare
Choose a tag to compare
  • Support for closed curves
  • Support for n-dimensions
  • Lookup values or positions along curve from any axis
  • Legacy support through CurveInterpolator2D class

This release has breaking changes. To migrate from v1 you can swap the CurveInterpolator class with the CurveInterpolator2D class, which allow you to use the same interface as before.

Breaking changes:

  • Removed methods getNormalAt, getAngleAt, x and y from CurveInterpolator class, as they are specific for 2 dimensions. The x and y methods should be replaced with the new lookup method.
  • getNormalAtT and getAngleAtT functions was removed from the core lib, as the is not relevant for higher dimensions and because they are trivial to implement using the getTangentAtT function (see CurveInterpolator2D)
  • The second argument to the CurveInterpolator class now takes an options-object, to set tension, arc divisions and now also if the curve should be closed or not.
  • The BBox interface was changed from an object of x1, x2, y1 and y2 properties to an object of properties min and max, where min and max are vectors containing the min and max values for all dimensions.

1.0.6

06 Jan 12:19
Compare
Choose a tag to compare
Fix vulnerabilities in dependencies

v1.0.5

25 Nov 09:21
Compare
Choose a tag to compare
Allow lookup margin to be overridden when calling x/y functions

v1.0.4

24 Nov 15:43
Compare
Choose a tag to compare

Dummy release to test github actions

v1.0.3

24 Nov 15:15
Compare
Choose a tag to compare
  • Invalidation of internal cached values of CurveInterpolator
  • Minor fixes

v1.0.1

24 Nov 12:18
Compare
Choose a tag to compare

Added getters for:

  • minX
  • maxX
  • minY
  • maxY

Caches bounding box if called without from and to parameters.

1.0.0

23 Nov 10:05
Compare
Choose a tag to compare

Version 1.0.0 is completly rewritten using typescript and adds many improvements and new features compared to v0.2.3.

  • Calculate bounding box for curve (or curve segment)
  • Correctly finds all intersection points along the curve given an value along the x or y axis.
  • All functions used by the CurveInterpolator class are exposed, so you can add your own behaviour by extending or using these functions stand-alone.
  • Typedoc documentation

Note that the old version returned only one solution for the x and y functions. Default in v1.0.0 returns an array with all solutions (intersections). You can control this by a second parameter named max. This parameter lets you specify the max number of solutions to return. If set to 1 (first) or -1 (last) the return type will be a number, otherwise an array will be returned.

Known issues;

  • For linear line segments there may be infinite solutions of x(y) or y(x). Currently, one solution per control point along the linear section is returned.