| 1 |
|
| 2 |
%% This is the documentation of the minim-hatching pattern library. To typeset |
| 3 |
%% this file, say: |
| 4 |
%% |
| 5 |
%% luatex --fmt=minim-mp minim-hatching-doc.mp |
| 6 |
|
| 7 |
input minim-hatching |
| 8 |
|
| 9 |
verbatimtex |
| 10 |
% work around a bug: pdf.setnames will do nothing if this is not called at least once. |
| 11 |
\pdfextension names{} % (TODO: remove after bug is fixed). |
| 12 |
\font \titlf = {Latin Modern Roman Dunhill} at 12pt |
| 13 |
\font \mainf = {Latin Modern Roman Unslanted} at 10pt \mainf |
| 14 |
\parindent 0em \parskip 1em |
| 15 |
\rightskip 0em plus 2em |
| 16 |
\startmetadata |
| 17 |
author {Esger Renkema} |
| 18 |
title {minim-hatching} |
| 19 |
date {2022-03-03} |
| 20 |
version {2022/1.1} |
| 21 |
keywords {MetaPost; tiling patterns} |
| 22 |
stopmetadata |
| 23 |
etex; |
| 24 |
|
| 25 |
def makepage = path page; page = unitsquare xscaled 210mm yscaled 297mm; |
| 26 |
setbounds currentpicture to page shifted (-7.1cm, 4cm-297mm); enddef; |
| 27 |
def xyscaled expr p = xscaled xpart p yscaled ypart p enddef; |
| 28 |
|
| 29 |
pickup pencircle scaled 0.4pt; save p; picture p; |
| 30 |
save w, h, o; (w, h, o) = (2cm, 1cm, 3mm); |
| 31 |
|
| 32 |
def table(expr n)(text i)(text t) = |
| 33 |
for d = t : x := 0; |
| 34 |
for s = i : |
| 35 |
if d = "=" : draw label(s) shifted (x+o, y+o); |
| 36 |
else: filldraw unitsquare xscaled w yscaled h shifted (x,y) |
| 37 |
withpattern(scantokens(s&" "&d&n)); fi |
| 38 |
x := x + w; |
| 39 |
endfor |
| 40 |
patname(d, n) |
| 41 |
y := y - h; |
| 42 |
endfor enddef; |
| 43 |
def double(expr l, r) = y:=y-h; |
| 44 |
filldraw unitsquare xscaled w yscaled h shifted (0,y) |
| 45 |
withpattern(scantokens(l)); |
| 46 |
filldraw unitsquare xscaled w yscaled h shifted (w,y) |
| 47 |
withpattern(scantokens(r)); |
| 48 |
draw label(l) shifted(2w+o, y+o); |
| 49 |
draw label(r) shifted(3w+o, y+o); enddef; |
| 50 |
|
| 51 |
vardef label(expr t)= |
| 52 |
save p; picture p; p := scantokens ("btex "&t&"\strut etex;"); |
| 53 |
setbounds p to unitsquare xyscaled urcorner p; p enddef; |
| 54 |
def patname(expr n, s) = |
| 55 |
if n <> "=" : draw label(n&s) shifted(x+o, y+o); fi enddef; |
| 56 |
def titl(expr t) = |
| 57 |
p := label("\titlf "&t); |
| 58 |
draw p shifted ((-2o, y+o) - lrcorner p); enddef; |
| 59 |
|
| 60 |
beginfig(1) y := 0; |
| 61 |
titl("Introduction"); |
| 62 |
p := btex \vtop{\hsize=9cm\noindent |
| 63 |
This is a small library of monochrome patterns for the minim-mp metapost processor. |
| 64 |
Load the patterns by saying \par |
| 65 |
\strut \qquad input minim-hatching;\par |
| 66 |
at the top of your metapost file or instance.\par |
| 67 |
I recommend printing this file, as patterns do not always display well on a computer screen. |
| 68 |
} etex shifted (0,o); |
| 69 |
draw p; y := y - ypart (urcorner p - lrcorner p) - h; |
| 70 |
titl("Line patterns"); |
| 71 |
table(" lines")("", "dense") |
| 72 |
("=", "horizontal", "vertical", "upward", "downward", "broken"); |
| 73 |
titl("Zigzag patterns"); |
| 74 |
table("zigzag")("horizontal", "vertical") |
| 75 |
("=", "" ); |
| 76 |
titl("Grid patterns"); |
| 77 |
table(" grid")("", "dense") |
| 78 |
("=", "", "upward", "downward", "diagonal", "horizontal", "vertical"); |
| 79 |
makepage endfig; |
| 80 |
|
| 81 |
verbatimtex \embedfile |
| 82 |
global file {EUPL-1.2-EN.txt} |
| 83 |
desc {Licence for this package (EUPL).} |
| 84 |
name LICENCE mimetype text/plain |
| 85 |
relation Unspecified uncompressed etex; |
| 86 |
|
| 87 |
beginfig(1) y := 0; |
| 88 |
titl("Dot patterns"); |
| 89 |
table(" dots")("sparse", "", "dense") |
| 90 |
("=", "", "square", "diamond", "heavy", "square heavy", "diamond heavy"); |
| 91 |
titl("Cloth patterns"); |
| 92 |
double("knit", "purl") |
| 93 |
double("weave", "dense weave") |
| 94 |
double("stitches", "crosses") |
| 95 |
double("chords", "tea cloth") |
| 96 |
y:=y-h; titl("Circle patterns"); |
| 97 |
table("")("", "small") |
| 98 |
("=", "circles", "square circles", "hexagons", "scales"); |
| 99 |
titl("Stone patterns"); |
| 100 |
double("bricks", "tiles"); |
| 101 |
y:=y-2h; titl("Licence"); |
| 102 |
p := btex |
| 103 |
\vtop{\hsize=9cm\noindent |
| 104 |
This package may be distributed under the terms of the European Union Public |
| 105 |
Licence (EUPL) version 1.2 or later. An english version of this licence has |
| 106 |
been included as an attachment to this file; copies in other languages can be |
| 107 |
obtained at |
| 108 |
$$\hbox to \hsize{\hss\hyperlink |
| 109 |
url {https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12}\relax |
| 110 |
https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\endlink\hss}$$ |
| 111 |
} etex shifted (0,y+o); |
| 112 |
draw p; |
| 113 |
makepage endfig; |
| 114 |
|
| 115 |
bye; |
| 116 |
|
| 117 |
|