Reference · Stroke order from KanjiVG: draw it, and find a kanji by drawing it
pathPointsfunction
Points along a path: its curves cut into steps straight pieces each. Reads what KanjiVG writes: M, C and S, absolute and relative.
Import it
import { pathPoints } from "@johnmorrisdotca/jisho/strokes";
Definition
function pathPoints(path: string, steps?: number): Point[]
Parameters
| Name | Type | Description |
|---|---|---|
path | string | An SVG path of a stroke. |
steps (optional) | number | How many pieces each curve is cut into. 6 unless given. |
Returns
Point[]
The points, from where the stroke starts to where it ends.
Examples
import { pathPoints } from "@johnmorrisdotca/jisho/strokes";
console.log(pathPoints("M0,0c10,0,20,0,30,0", 3).length); // 44What it prints (run when this page was built)