Drawings

layout: drawing reads a figure as a dimensioned sheet: every child sits on one shared datum, and the links become annotations whose values are measured off the geometry rather than typed.

A plate and two dimensions

{ layout: drawing; density: 3; }

|rect#plate| { width: 120; height: 70; }

plate:left (-) plate:right { side: bottom; tol: 0.2; }
plate:top (-) plate:bottom { side: right; }
120±0.2 70

A drawing replaces flow with a datum: every child’s origin lands on it, and links stop being wires.

(-) is the linear measure. It spans two anchors and renders the distance it finds — so 120 and 70 came from the rectangle, not from the annotation, and nothing here types a number twice.

  • tol: 0.2 appends ±0.2 to whatever was measured.
  • side: names the edge a dimension stands off. It always sits outside the geometry.
  • density: is pixels per millimetre, for the screen alone. No measured value reads it.

A profile drawn with the pen

{ layout: drawing; density: 3; }

|sketch#gusset| {
  draw: move(-40, 40) right(80):base fillet(6):heel up(80):wall
        line(-80, 80):flank close();
}

gusset:left (-) gusset:right { side: bottom; }
gusset:heel (o)
gusset:flank (<) gusset:base
80 R6 45°

|sketch| is a pen that folds to a path. draw: is a list of calls read left to right — move, right, up, line, arc, curve, fillet, chamfer, close.

A :segment glued to a call names what that call drew, which is how a dimension lands on it later: fillet(6):heel makes the fillet answer to heel.

Each glyph pictures what it measures:

  • (o) on a named arc reads its radius — R6.
  • (<) between two line-like anchors draws the angle arc at their intersection — 45°.

Holes, patterns and callouts

{ layout: drawing; density: 3; }

|rect#plate| { width: 140; height: 60; } [
  |hole#bolt| { width: 8; translate: -45 0; pattern: grid(3, 1, 45, 0); }
]

plate:left (-) plate.bolt (-) plate:right { side: bottom; }
plate.bolt.1 (-) plate.bolt.2 { side: top; }
plate.bolt (o) "H7"
plate:bottom >- "A"
plate:top-left <- "BREAK EDGES 0.5"
25 115 45 3× ⌀8 H7 A BREAK EDGES 0.5

A part’s features ride in its [ ], rigid with it. |hole| is round — width: is its diameter — and it punches the part and draws its own centre marks.

pattern: grid(3, 1, 45, 0) replicates it three across. The seed keeps the node’s own position, and plate.bolt.2 addresses a copy by index.

A callout is a one-ended link written tip-first:

  • <- lands an arrow on the outline and runs the line out to the text.
  • >- plants a datum triangle and frames its letter.

A measured callout composes in a fixed order — count, glyph, number, then the label’s words — so plate.bolt (o) "H7" reads 3× ⌀8 H7 with only the H7 typed.

A turned part that names its own thread

|drawing#view| "MAIN SHAFT" { scale: 0.75; } [
  |sketch#shaft| {
    draw: move(-60, 0) up(9) chamfer(1.5) right(34):m18 fillet(3)
          up(6) right(46):brg down(15);
    revolve: x-axis;
    thread: m18 1.5;
  }

  shaft:left (-) shaft:right { side: bottom; }
  shaft:brg (o) { side: right; tol: h6; }
  shaft:m18 <- { side: top; }
]
80 ⌀30 h6 M18×1.5 MAIN SHAFT

revolve: x-axis folds the half profile into the whole part, and generates the chrome a lathe drawing carries — the axis centreline, and a shoulder line at each sharp diameter change. There is none at the fillet(3), because it joins tangentially.

On a revolved profile the glyphs change meaning to suit:

  • (o) on a segment reads the span across the axis, as a diameter — ⌀30 h6.
  • thread: m18 1.5 dresses that run as an ISO thread, and the bare leader composes its spec from the geometry: M18×1.5.

scale: 0.75 is the view’s drafting ratio. The dimensions still read true, and the view’s label lowers to a title below it.

A sheet: two views and a title block

|page| { sheet: a5 landscape; gap: 50; align: origin; } [
  |drawing#side| "LOCATING PIN" { scale: 1.5; } [
    |sketch#pin| {
      draw: move(-30, 0) up(6) right(20):shank chamfer(1) up(3) right(40):head down(9);
      revolve: x-axis;
    }
    pin:left (-) pin:right { side: bottom; }
    pin:head (o) { side: right; }
  ]
  |drawing#end| { scale: 1.5; } [
    |oval#od| { width: 18; height: 18; }
    |oval| { width: 12; height: 12; }
    od (o)
  ]
  |title-block| {
    title: "Locating pin"; drawing-number: "LN-0031"; revision: "A"; sheet-number: "1/1";
  }
]
60 ⌀18 LOCATING PIN ⌀18 Title Locating pin Dwg No. LN-0031 Rev A Sheet 1/1 1 2 3 4 1 2 3 4 A B A B

There is no |view| type. A multi-view sheet is just drawings in a flow, and align: origin puts their datums on one line so the views share an axis — which is the whole of projection here.

A |page| is the trimmed ISO sheet. sheet: a5 landscape generates its frame, zone references and centring marks, and a |title-block| seats itself in the frame’s corner from the fields you name.

The page’s width and height are real millimetres, so a print comes out true to scale.

Go deeper

The full drawing reference covers mates and seating, sections and details, hatching, projection lines and the GD&T frames.