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:cutandground0.5 mm,marker0.35 mm,silhouette0.25 mm,projectedandsurface0.18 mm,hiddenanddatum0.13 mm. A paper style changes these withroles.<role>, stepssilhouetteandprojectedlines heavier bystyle.depthwithdepthBands, and removes an edge class withedgeClasses.<class>.visible: false; see Paper styles. - A wall the cut slices carries no state and prints with its
PEN_TABLEpen, which is the cut pen. - Types without a row in
PLAN_STATE_PENSkeep theirPEN_TABLEpen in every state. - Only saved plan views drawn from a build set states. Inline viewports and
PlanDrawingExtractordrawings carry none. - A region whose
style.fillnames ahatchdraws that entry ofHATCH_PATTERNSinstead of a fill, over any pen hatch. A cut wall gets one from its saved material throughwallMaterialDraw, 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
HatchSpecis one of three kinds. With nokind, orkind: 'lines', it is parallel lines atangleDeg,spacingMmapart, with an optional second pass atcrossAngleDeg; a stored spec with nokinddraws as before.kind: 'stud'draws one zigzag between the two long faces of the region, one tooth everypitchMmalong its longest edge;kind: 'batt'draws one looped line that touches both long faces, one loop everypitchMm. 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.studandHATCH_PATTERNS.battare 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 thedata-materialattribute. MATERIAL_PENSholds the pens of thePLASTER,AIRandMEMBRANElayers of a wall type.- A wall, wall layer or roof whose
materialis a key ofBuildingModel.materialscuts with that material’scutHatch, or the solid poché when it has none;wallMaterialDraw(material, materials)gives the same answer. A material key wins over aWallMaterialof the same name. - A seen face of a material with a
surfacePatterndraws the pattern aslineprimitives clipped to the face, each withstyle.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.layeris the index of the layer in the type andstyle.materialits material, filled as the table below says. APLASTERlayer prints theMATERIAL_PENS.PLASTERpoché and anAIRlayer no fill. A line is drawn only where two layers of different materials meet, withstyle.layerBoundaryand 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${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.
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 onstyle.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’sHATCH_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
Howmaterial 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.Line cap. Absent is the renderer’s default (butt); a hand stroke wants round. Unset on every pen
the shipped table resolves.
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.