patterns[] methods
Every method of the patterns[] lane. Each step of a patterns[] entry returns a pattern, and the lane's entries are addressed by the identity schema/lanes.ts declares for it.
| Method | Description | Arg | Type | Default | Meaning |
|---|---|---|---|---|---|
pattern | Pattern — Hatch pattern record — the line families that fill a region, and nothing about where they are drawn. patterns[] lane only; referenced by name from a hatch's pattern arg and from a material's cut/surface pattern. That split is what makes it shareable, and what every interchange format requires (DXF names a pattern at group code 2, SVG references one by id). | name | string | 'Pattern' | Pattern name (string expression; quote literals). Unique among resolved names. |
lines | object | [] | Array of { line, lineWidth?, color?, dotSize? }, painted in order. line is { angle (degrees), origin?, shift? (slide ALONG the line between successive lines), spacing (distance ACROSS), dashes? } and may be spelled flat — one entry is exactly one data line of an AutoCAD .pat file. dashes uses the SVG spelling: all values positive, even positions draw and odd positions lift; a 0 in a draw position is a dot painted at dotSize; absent means a solid line. EMPTY is legitimate: a pattern that draws nothing is how a region gets a fill and no linework over it. | ||
lengthSpace | string | 'model' (default) measures spacing/shift/dashes/lineWidth in MODEL millimetres, so the pattern shrinks with the drawing. 'paper' measures them in SHEET millimetres, which is how every drafting standard specifies a hatch — and it can only be drawn by a caller that supplies the scale. NOTHING IN THIS REPO SUPPLIES ONE YET: the two render paths fold MODEL space, where there is no sheet, so a paper pattern reaching them throws by design rather than printing a 2mm hatch at 0.02mm on a 1 view. |