Skip to main content
A pen sets how a primitive is inked on a sheet: colour, line weight, dash and fill. resolvePen reads the pen from the primitive’s style. Plan primitives of walls, columns, beams, stairs, railings and roofs can carry a plan state on style.edgeClass: PlanCut (sliced by the cut plane), PlanBelow (wholly below it) or PlanAbove (wholly above it). A stated primitive reads its pen from PLAN_STATE_PENS, not from PEN_TABLE.

Import

Example

Notes

  • In a section or an elevation a line reads its weight from its style.role, unless its type (railing, column, site boundary, context building) or a glass cut has its own: cut and ground 0.5 mm, marker 0.35 mm, silhouette 0.25 mm, projected and surface 0.18 mm, hidden and datum 0.13 mm. A paper style changes these with roles.<role>, steps silhouette and projected lines heavier by style.depth with depthBands, and removes an edge class with edgeClasses.<class>.visible: false; see Paper styles.
  • A wall the cut slices carries no state and prints with its PEN_TABLE pen, which is the cut pen.
  • Types without a row in PLAN_STATE_PENS keep their PEN_TABLE pen in every state.
  • Only saved plan views drawn from a build set states. Inline viewports and PlanDrawingExtractor drawings carry none.
  • A region whose style.fill names a hatch draws that entry of HATCH_PATTERNS instead of a fill, over any pen hatch. A cut wall gets one from its saved material through wallMaterialDraw, in plans and sections. A wall with no material keeps the solid poché.
  • A solid fill with no colour draws the poché of its class pen, else the cut poché #4d4d4d, in plans and sections. It does not print black. Give a fill an explicit colour, such as [0, 0, 0], to print it black.
  • A HatchSpec is one of three kinds. With no kind, or kind: 'lines', it is parallel lines at angleDeg, spacingMm apart, with an optional second pass at crossAngleDeg; a stored spec with no kind draws as before. kind: 'stud' draws one zigzag between the two long faces of the region, one tooth every pitchMm along its longest edge; kind: 'batt' draws one looped line that touches both long faces, one loop every pitchMm. On a curved region, both run around the centre of its longest arc. Every line is clipped to the region and its holes. HATCH_PATTERNS.stud and HATCH_PATTERNS.batt are 2 mm pitch, 0.13 mm, black.
  • A plan cut of a saved wall that names a material carries it on style.material; a sheet exported as markup carries it on the region as the data-material attribute.
  • MATERIAL_PENS holds the pens of the PLASTER, AIR and MEMBRANE layers of a wall type.
  • A wall, wall layer or roof whose material is a key of BuildingModel.materials cuts with that material’s cutHatch, or the solid poché when it has none; wallMaterialDraw(material, materials) gives the same answer. A material key wins over a WallMaterial of the same name.
  • A seen face of a material with a surfacePattern draws the pattern as line primitives clipped to the face, each with style.surfacePattern. They ink with the surface pattern pen, 0.13 mm and continuous, whatever their element’s class, edge class or a paper style’s class entry says. Spacing is in metres, so it scales with the sheet. Elevations draw patterns on every face that does not face down; sections only on faces that face up (roofs), so the inside of a room stays blank. A round wall draws its courses and its render dots, no joints or bars. A roof plan draws a roof’s pattern on each slope, courses parallel to its eave.
  • A wall with a wall type draws one region per layer, in plans and sections: style.layer is the index of the layer in the type and style.material its material, filled as the table below says. A PLASTER layer prints the MATERIAL_PENS.PLASTER poché and an AIR layer no fill. A line is drawn only where two layers of different materials meet, with style.layerBoundary and at 0.25 mm, half the cut wall pen; two layers of the same material meet with no line, also across a join. The closed outline of the joined walls is drawn once, as for walls without a type. The live plan editor fills each layer with a colour per material instead of its hatch.
Spacing is measured along the face: on a slope, along the slope.

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 $&#123;ogType&#125;|$&#123;edgeClass&#125;|$&#123;kind&#125;, 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 by ElementType.

PLAN_STATE_PENS

The pen of each plan state, for the types that draw by state.

isPlanCutState

Whether an edge class names a plan state.

PlanCutState

The three plan states of a primitive against the plan’s cut plane, carried on style.edgeClass: sliced by the cut, wholly below it, or wholly above it.

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.

DRAWING_HATCH_NAMES

The names of the material hatches, the keys of the paper’s HATCH_PATTERNS.

MATERIAL_PENS

The pens of the wall layer materials that draw neither a hatch nor the wall’s solid poché, keyed by material: PLASTER a lighter solid poché than the structure, AIR an outline with no fill, and MEMBRANE the single line drawn at the layer’s offset.

wallMaterialDraw

How material draws in a cut.

WallMaterialDraw API

How a wall material draws where a plan or section cuts it: a named hatch, the solid poché, no fill at all (an air gap), or a single line at the layer’s offset and no region (a membrane).

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.
number
Opacity of the ink, from 0 to 1. Unset on every pen the shipped table resolves.

PenContext

Built once per viewport in placeDrawing; the memo lives here, never at module level, so a render is a pure function of its inputs.

PrimitiveKind

HatchSpec

A region’s hatch.
Last modified on November 16, 2026