expandStroke
expandStroke(
subpath,width,options?):StrokeGeometry
Defined in: core/stroke.ts:52
Expand a polyline into fill triangles for a stroke of the given width.
Each straight segment becomes a quad (2 triangles). Each join is filled per side: the
INNER side is a bevel (harmless overlap with the segment quads for opaque fills); the
OUTER side is a miter to a sharp apex — reproducing the Canvas/SVG painter look —
unless join is “bevel” (flat) or “round” (an arc fan), or the miter exceeds
miterLimit (then bevel). Closed subpaths
join every corner including the wrap-around; open subpaths use butt caps (no extra cap
geometry — round/square caps are deferred).
Width/join are geometry parameters: changing them requires re-expanding. (Recoloring a stroke does not — color lives in a separate side-table.)
Parameters
Section titled “Parameters”subpath
Section titled “subpath”number
options?
Section titled “options?”StrokeOptions = {}