One pattern, repeated across whatever it fills

Hatching is how a technical drawing says what a thing is made of, and how a map says which zone is which, without spending a colour on it. It has to survive being printed in black and white, and it has to be the identical hatch in every panel of every drawing — which is exactly what lines drawn one at a time are not.

A pattern is a small drawing and a gap, carried once in the file however wide the area filled with it, and it touches only what it paints — which is what lets two of them cross and both still be read. Six panels show what that buys, and a name in large letters at the foot is filled with the brick-wall drawing: what gets filled need not be a rectangle, it can be letters.

The six are worth walking through one at a time. Bars repeated at the width of a bar give a tight hatch; the same bars repeated at three times that give an airy one, and that gap alone is what tells two materials apart on one drawing. A single dot with more room around it gives a grain instead. Bars leaning over give a third material without a second drawing having been made. The brick wall shows what becomes of whatever runs past the edge of the small drawing: it is cut there. And every pattern is pinned to the page rather than to the shape it fills, so two panels side by side share one grid and the hatch does not jump where they meet.

What this example shows

  • A pattern drawn once and repeated across any area.
  • A slant got without redrawing the pattern.
  • Patterns pinned to the page, so neighbouring panels share a grid.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

One pattern, repeated across whatever it fills, first page

Optimised, this document weighs 13.4 kB — at least 85 % lighter than most PDF generators would write it

The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.

Examples near this one

Cutting out what you draw

The same area of stripes shown through two windows: a plain disc, and a ring whose middle is left bare.

Transparency and blend modes

Half-transparent fills that overlap and mix, one orange square laid over a blue bar in four different ways of mixing colours, and a line of overlapping letters painted two ways.

Gradients in a line, in a circle, and read from a function

Five panels: a header that fades out, the same fade on the diagonal, a glow carried past its own circle so the corners fill, a blend that goes by way of a third colour, and a checkerboard whose colour is worked out from where each point stands, redder to the right and greener towards the top.

Four kinds of mesh, every corner its own colour

Six triangles round a centre they share, their edges stroked over the paint; a lattice of points in the four printing inks; a patch whose four sides are curves; and the same patch pulled about by four points inside it.

Every example, by subject