Skip to content

editor / contourPiecesToPathData

Function: contourPiecesToPathData() ​

contourPiecesToPathData(pieces): string

Defined in: io/contour-pieces-to-path-data.ts:25

Path data of a closed sequence of segments and arcs: M start L … A … Z.

moveto starts at the first piece (§9.3.3); each segment becomes a lineto to its end (§9.3.5) and each arc an elliptical arc command (§9.3.8); closepath ends the path (§9.3.4). A final segment is not written: closepath draws that straight line back to the start, as the sharp path data does. No piece gives an empty d.

Parameters ​

pieces ​

readonly ContourPiece[]

segments and arcs in drawing order, each starting where the previous one ends

Returns ​

string

the d attribute of the <path>

Kind ​

format

See ​

REF-SVG2-PATHS