Skip to main content

Class: InterpolatedSpline

PathBuilding.InterpolatedSpline(layout, points, pointPropsopt, splineParametersopt)

new InterpolatedSpline(layout, points, pointPropsopt, splineParametersopt)

Parameters:
NameTypeAttributesDefaultDescription
layoutArray.<PathBuilding.PathPoint.Property>The layout of the input points
pointsArray.<float>Float32Array
pointPropsPathBuilding.PathPointProperties<optional>
splineParametersArray.<PathBuilding.SplineParameter><optional>[]SplineParameter per point from SplineInterpolator when keepSplineParameters property is configured
Properties:
NameTypeDescription
styleRendering.InkStyleSpline 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:
NameTypeDescription
propertyPathBuilding.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:
NameTypeDescription
indexintIndex of interploated point

Overrides:

Returns:

Point for given index with pre-filled pointProps

Type

PathBuilding.PathPoint

getPointParameter(index) → PathBuilding.SplineParameter

Get spline parameter for interploated point

Parameters:
NameTypeDescription
indexintIndex of interploated point
Returns:

Spline parameter

Type

PathBuilding.SplineParameter

getPointSegmentIndex(index) → {int}

Get segment index for point in current spline

Parameters:
NameTypeDescription
indexintIndex of interploated point
Returns:

Index of spline segment

Type

int

getPointT(index) → {float}

Get T value for point in current spline

Parameters:
NameTypeDescription
indexintIndex of interploated point
Returns:

T value

Type

float

getPoint[PropertyName](index) → {float}

Extracts point property value based on underlying layout

Parameters:
NameTypeDescription
indexintPoint index

Overrides:

Returns:

Property value

Type

float

Example
getPointX, getPointY, getPointSize, ...

setPoint(index, Replacement)

Parameters:
NameTypeDescription
indexintPath point index
ReplacementPathBuilding.PathPointpoint

Overrides:

setPoint[PropertyName](index, value)

Set point property value based on underlying layout

Parameters:
NameTypeDescription
indexintPoint index
valuefloatProperty value

Overrides:

Example
setPointX, setPointY, setPointSize, ...

slice(fragment) → PathBuilding.InterpolatedSpline

Extracts a section of the calling path and returns a new path

Parameters:
NameTypeDescription
fragmentPathBuilding.PathFragmentPath part descriptor

Overrides:

Returns:

Sliced path

Type

PathBuilding.InterpolatedSpline

slicePoints(pointIndexStart, pointIndexEnd) → {Array.<float>|Float32Array}

Extracts path fragment data

Parameters:
NameTypeDescription
pointIndexStartintStarting point index
pointIndexEndintFinal 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:
NameTypeDescription
matrixCommon.MatrixTransform matrix

Overrides:

Returns:

new path instance (type is inheritance dependent)

Type

PathBuilding.Path|PathImpl

transformSelf(matrix)

Self transform path points

Parameters:
NameTypeDescription
matrixCommon.MatrixTransform matrix

Overrides:

(static) fromJSON(data) → PathBuilding.InterpolatedSpline

Deserialize from JSON

Parameters:
NameTypeDescription
dataJSONInterpolatedSpline data
Returns:

InterpolatedSpline instance

Type

PathBuilding.InterpolatedSpline

Home