Class: InterpolatedSpline
PathBuilding.InterpolatedSpline(layout, points, pointPropsopt, splineParametersopt)
new InterpolatedSpline(layout, points, pointPropsopt, splineParametersopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layout | Array.<PathBuilding.PathPoint.Property> | The layout of the input points | ||
points | Array.<float> | Float32Array | ||
pointProps | PathBuilding.PathPointProperties | <optional> | ||
splineParameters | Array.<PathBuilding.SplineParameter> | <optional> | [] | SplineParameter per point from SplineInterpolator when keepSplineParameters property is configured |
Properties:
Name | Type | Description |
---|---|---|
style | Rendering.InkStyle | Spline stylesheet |
Since:
- version 3.0
Extends
Methods
clone() → PathBuilding.InterpolatedSpline
Clone instance
Overrides:
Returns:
InterpolatedSpline instance
Type
PathBuilding.InterpolatedSpline
getChannelData(property) → {Float32Array|Uint8Array}
Extracts property values from path
Parameters:
Name | Type | Description |
---|---|---|
property | PathBuilding.PathPoint.Property |
Overrides:
Returns:
channel data, where Uint8Array is applicable for color channels
Type
Float32Array|Uint8Array
getPoint(index) → PathBuilding.PathPoint
Get point instance from the current spline
Parameters:
Name | Type | Description |
---|---|---|
index | int | Index of interploated point |
Overrides:
Returns:
Point for given index with pre-filled pointProps
Type
getPointParameter(index) → PathBuilding.SplineParameter
Get spline parameter for interploated point
Parameters:
Name | Type | Description |
---|---|---|
index | int | Index of interploated point |
Returns:
Spline parameter
Type
getPointSegmentIndex(index) → {int}
Get segment index for point in current spline
Parameters:
Name | Type | Description |
---|---|---|
index | int | Index of interploated point |
Returns:
Index of spline segment
Type
int
getPointT(index) → {float}
Get T value for point in current spline
Parameters:
Name | Type | Description |
---|---|---|
index | int | Index of interploated point |
Returns:
T value
Type
float
getPoint[PropertyName](index) → {float}
Extracts point property value based on underlying layout
Parameters:
Name | Type | Description |
---|---|---|
index | int | Point index |
Overrides:
Returns:
Property value
Type
float
Example
getPointX, getPointY, getPointSize, ...
setPoint(index, Replacement)
Parameters:
Name | Type | Description |
---|---|---|
index | int | Path point index |
Replacement | PathBuilding.PathPoint | point |
Overrides:
setPoint[PropertyName](index, value)
Set point property value based on underlying layout
Parameters:
Name | Type | Description |
---|---|---|
index | int | Point index |
value | float | Property value |
Overrides:
Example
setPointX, setPointY, setPointSize, ...
slice(fragment) → PathBuilding.InterpolatedSpline
Extracts a section of the calling path and returns a new path
Parameters:
Name | Type | Description |
---|---|---|
fragment | PathBuilding.PathFragment | Path part descriptor |
Overrides:
Returns:
Sliced path
Type
PathBuilding.InterpolatedSpline
slicePoints(pointIndexStart, pointIndexEnd) → {Array.<float>|Float32Array}
Extracts path fragment data
Parameters:
Name | Type | Description |
---|---|---|
pointIndexStart | int | Starting point index |
pointIndexEnd | int | Final point index |
Overrides:
Returns:
Sliced data
Type
Array.<float>|Float32Array
toJSON() → {JSON}
Serialize to JSON
Overrides:
Returns:
InterpolatedSpline data
Type
JSON
toSVGPath() → {string}
Converts path geometry to SVG path data
Overrides:
Returns:
SVG path
Type
string
transform(matrix) → {PathBuilding.Path|PathImpl}
Transform path points
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
Overrides:
Returns:
new path instance (type is inheritance dependent)
Type
PathBuilding.Path|PathImpl
transformSelf(matrix)
Self transform path points
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
Overrides:
(static) fromJSON(data) → PathBuilding.InterpolatedSpline
Deserialize from JSON
Parameters:
Name | Type | Description |
---|---|---|
data | JSON | InterpolatedSpline data |
Returns:
InterpolatedSpline instance
Type
PathBuilding.InterpolatedSpline