Import
resolvePen
penFor
The ink a primitive is drawn with.penContextFor
The per-viewport context: the policy plus an empty memo.resolveInk
Class resolution, memoised per${ogType}|${edgeClass}|${kind}, then the producer’s own overlay: an explicit width always wins (a producer that measured something — and placeDrawing bakes the resolved width back on, so the common case is a float compare and no allocation); an explicit fill wins only where the style allows it.
visibleUnder
Whether a style draws this primitive at all (ClassStyle.visible).
lineWeightFor
stepUp
One rung heavier on PEN_LADDER_MM — the sibling of stepDown, with the same rule for weights that are not on the ladder: returned unchanged, never snapped.stepDown
One rung lighter on PEN_LADDER_MM.hatchLines
Hatch lines for a region, in the region’s own coordinates (paper mm when the region has already been placed).PEN_TABLE
The drafting palette, keyed byElementType.
PEN_LADDER_MM
ISO 128 line-width ladder, in millimetres.EDGE_CLASS_MODIFIER
How an HLR edge class modifies the pen its element already resolved to.HATCH_PATTERNS
Material hatches, for the drawings that want them.DASH_HIDDEN
Dashed narrow — hidden edges, things concealed by what is in front.DASH_CENTRE
Long-dashed dotted narrow — centre lines, axes of symmetry.DASH_PHANTOM
Long-dashed double-dotted narrow — adjacent parts, outlines beyond the cut.DASH_CUTTING
Long-dashed dotted wide — cutting planes.Types
Pen
How one primitive is inked on paper.string
required
Drafting ink, as a CSS colour. Never the element’s 3D material colour.
number
required
Lineweight in paper millimetres — a rung on PEN_LADDER_MM.
number[]
Dash runs in paper mm. Absent or empty means continuous.
string
Solid poché for
region primitives. Mutually exclusive with hatch.HatchSpec
Hatched poché for
region primitives. Mutually exclusive with fill.'butt' | 'round'
Line cap. Absent is the renderer’s default (butt); a hand stroke wants round. Unset on every pen
the shipped table resolves.
false
false draws a region as fill only, with no outline at all — stroke="none", never a zero
width, which PDF renders as the thinnest line the device can make. Unset on every pen the shipped
table resolves.PenContext
Built once per viewport inplaceDrawing; the memo lives here, never at module level, so a render is a pure function of its inputs.
PrimitiveKind
HatchSpec
A region’s hatch.number
required
number
required
number
required
string
required
number
A second pass at this angle — how cross-hatched materials are drawn.