hatchData producers
Every producer whose return is hatchData[] — what it creates is concatenated into the data stream. Authored as a step in an objects[] chain.
| Method | Description | Arg | Type | Default | Meaning |
|---|---|---|---|---|---|
hatch | Hatch — Build a hatch document: a region, plus the NAME of the patterns[] record whose line families fill it. The pattern is named and never inlined — two hatches drawn with concrete must be the same concrete, one edit must reach both, and every interchange format references a pattern by name (DXF at group code 2, SVG by id from defs). Everything here beside the name says WHERE the pattern sits, which is the half that belongs to this placement. | region | object | null | The region being filled: a Curve2d document { curves: [...] } of CLOSED rings, with an optional transformation placing their plane in the world. Nested rings punch holes by the even-odd rule — no ring declares itself an island. An open ring throws. |
pattern | string | 'Pattern' | patterns[] record name (quote literals). A name with no record throws, naming what was declared — a blank region would look like an authoring choice. | ||
angle | angle | 0 | Rotation of every layer about the hatch origin, in degrees (DXF/.pat convention). | ||
scale | number | 1 | Uniform scale about the origin, multiplying every layer's shift, spacing, dashes and origin. Anisotropy belongs in a layer's own numbers. | ||
origin | object | Where the pattern is anchored, in hatch space, as [x, y]. Absent = [0, 0] of hatch space — NOT the region's own extent: two regions sharing a plane share hatch space, so their hatching lines up across the edge between them. | |||
color | color | One colour for every layer, overriding each layer's own. A standard asks for the same pattern in another colour far more often than for a different pattern; duplicating the record to change a colour is how one pattern becomes six. | |||
fill | object | Paint behind every layer, over the whole region: { type: 'solid', color } or { type: 'linearGradient' | 'radialGradient', stops, start, end, repeat? }. Absent = only the lines are drawn. |