Constructor # new module:Spline(positionDefinition, points, tensionopt, optionsopt) Spline constructor Parameters: Name Type Attributes Default Description positionDefinition PositionDefinition First point points Array.<PositionDefinition> | PositionDefinition Set of points to go through or a single target point tension Number <optional> Spline.defaultTension Ratio of tension between points (0 means straight line, can take any value, but with weird results above 1) options LineOptions <optional> Drawing options Source: modules/spline/spline.js, line 15 Extends module:Line Members # (static) defaultTension :Number Default ratio of tension Type: Number Source: modules/spline/spline.js, line 73 # tension :Number Type: Number Source: modules/spline/spline.js, line 29 Methods # (static) from(definition) → {Spline} Parameters: Name Type Description definition Object Spline definition Source: modules/spline/spline.js, line 65 Returns: Type Spline # (static) splineThrough(path, points, tensionopt, _correctionopt) Draw a spline through points using a tension (first point should be current position) Parameters: Name Type Attributes Default Description path Path2D | CanvasRenderingContext2D Current drawing path points Array.<PositionDefinition> Points to use (need at least 2 points) tension Number <optional> Spline.defaultTension Ratio of tension _correction PositionDefinition <optional> Apply position correction to all points (used by the library) Source: modules/spline/spline.js, line 84 # trace(path) → {Spline} Draw the spline Parameters: Name Type Description path Path2D Current drawing path Overrides: module:Line#trace Source: modules/spline/spline.js, line 37 Returns: Itself Type Spline # (inner) getControlPoint(points, tensionopt) → {Array.<Position>} Returns control points for a point in a spline (needs before and after, 3 points in total) Parameters: Name Type Attributes Default Description points Array.<Position> 4 points to use (before, one, two, after) tension Number <optional> Spline.defaultTension Ratio of tension Source: modules/spline/spline.js, line 119 Returns: Type Array.<Position>