Strokes

This Nile pipeline, StrokeOutline, takes a stream of cubic curves (the paths, written in plain TypeScript) and outlines them with gezira's stroke.nl, unmodified. StrokeBezierPath offsets each curve to both sides, subdividing it where needed (OffsetBezier replaces itself with a pipeline mid-stream), joins neighbouring segments and caps the ends, stroking the second side with DupCat and Reverse. FillBeziers then clips and rasterizes the outline, and PaintSpans turns the spans into coloured pixels, which TypeScript writes to the canvas. The pipeline is parameterized by a transform, the stroke width, the join (round, or a miter limit) and the cap (round, butt or square). The faint white lines are the input paths.

This page: about 240 lines of Nile and 180 lines of TypeScript, compiled by umgeni.

See the Nile pipeline

How to use: choose a cap and a join, drag the width (and the miter limit, for miter joins), and tick show outline to see the offset beziers the stroker produces.

cap: join: